- #include <stdio.h>
- /*#include <iostream> //引入函數庫
- #include <cstdlib>
- using namespace std; */
- int main(void){
- unsigned i,n,j,N,c,k;
- /*cin >> n >> N;*/
- scanf("%u %u",&n,&N);
- for(i=0;i<n;i++)
- {
- unsigned long s[200000]={0};
- c=0;
- for(j=0;j<N;j++)
- {
- /*cin >> k;*/
- scanf("%u",&k);
- s[k]=1;
- }
- for(j=0;j<N;j++)
- {
- /*cin >> k;*/
- scanf("%u",&k);
- if(s[k] == 1){
- c++;
- }
- }
- /*cout << c << endl;*/
- printf("%u\n",c);
- }
- /*system("pause");*/
- return 0;
- }
複製代碼 |