Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<iostream>
- #include<stdlib.h>
- #include<fstream>
- #include<string>
- #include<vector>
- #include<queue>
- using namespace std;
- fstream in,out;
- int cmp(int a[] , int b[]){
- int i;
- int flag=1;
- for(i=0;i<33&& flag==1;i++){
- if(a[i]!=b[i]){
- flag=0;
- }
- }
- return flag;
- }
- int main(){
- in.open("input.txt",ios::in);
- out.open("output.txt",ios::out);
- int s,t,q,i,j,value,cont=0;
- //bool flag;
- in>>t>>s>>q;
- int tests[t][33];
- int answ[33];
- for(i=0;i<t;i++){
- for(j=0;j<33;j++){
- tests[i][j]=0;
- }
- }
- for(i=0;i<t;i++){
- for(j=0;j<q;j++){
- in>>value;
- tests[i][value]++;
- }
- }
- for(i=0;i<s;i++){
- for(j=0;j<=32;j++){
- answ[j]=0;
- }
- for(j=0;j<q;j++){
- in>>value;
- answ[value]++;
- }
- for(j=0;j<t;j++){
- cont=cont+cmp(answ,tests[j]);
- }
- }
- out<<cont;
- in.close();
- out.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment