Guest User

Untitled

a guest
Dec 27th, 2017
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<iostream>
  3. #include<stdlib.h>
  4. #include<fstream>
  5. #include<string>
  6. #include<vector>
  7. #include<queue>
  8. using namespace std;
  9. fstream in,out;
  10. int cmp(int a[] , int b[]){
  11. int i;
  12. int flag=1;
  13. for(i=0;i<33&& flag==1;i++){
  14. if(a[i]!=b[i]){
  15. flag=0;
  16. }
  17. }
  18. return flag;
  19. }
  20. int main(){
  21. in.open("input.txt",ios::in);
  22. out.open("output.txt",ios::out);
  23. int s,t,q,i,j,value,cont=0;
  24. //bool flag;
  25. in>>t>>s>>q;
  26. int tests[t][33];
  27. int answ[33];
  28.  
  29. for(i=0;i<t;i++){
  30. for(j=0;j<33;j++){
  31. tests[i][j]=0;
  32. }
  33. }
  34.  
  35. for(i=0;i<t;i++){
  36. for(j=0;j<q;j++){
  37. in>>value;
  38. tests[i][value]++;
  39. }
  40. }
  41.  
  42.  
  43. for(i=0;i<s;i++){
  44. for(j=0;j<=32;j++){
  45. answ[j]=0;
  46. }
  47. for(j=0;j<q;j++){
  48. in>>value;
  49. answ[value]++;
  50. }
  51.  
  52. for(j=0;j<t;j++){
  53. cont=cont+cmp(answ,tests[j]);
  54.  
  55. }
  56.  
  57. }
  58. out<<cont;
  59. in.close();
  60. out.close();
  61. return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment