返回列表 發帖
  1. #include <stdio.h>
  2. /*#include <iostream> //引入函數庫
  3. #include <cstdlib>
  4. using namespace std; */
  5. int main(void){

  6.     unsigned i,n,j,N,c,k;
  7.     /*cin >> n >> N;*/
  8.     scanf("%u %u",&n,&N);
  9.      for(i=0;i<n;i++)
  10.      {
  11.       unsigned long s[200000]={0};
  12.           c=0;
  13.           for(j=0;j<N;j++)
  14.           {
  15.               /*cin >> k;*/
  16.               scanf("%u",&k);
  17.               s[k]=1;
  18.           }
  19.           for(j=0;j<N;j++)
  20.           {
  21.                    /*cin >> k;*/
  22.                    scanf("%u",&k);
  23.               if(s[k] == 1){

  24.                       c++;
  25.               }
  26.           }
  27.       /*cout << c << endl;*/
  28.       printf("%u\n",c);
  29.       }

  30.     /*system("pause");*/
  31.     return 0;
  32.     }
複製代碼
離離草原上
一歲一枯榮
野火燒不盡
春風吹又生

TOP

返回列表