本帖最後由 chuangjoy 於 2010-11-6 11:20 編輯
- #include <iostream> //引入函數庫
- #include <cstdlib>
- using namespace std;
- int main(void){
- unsigned i,n,j,N,c,k;
- cin >> n >> N;
-
- for(i=0;i<n;i++)
- {
- unsigned long s[200000]={0};
- c=0;
- for(j=0;j<N;j++)
- {
- cin >> k;
- s[k]=1;
- }
- for(j=0;j<N;j++)
- {
- cin >> k;
- if(s[k] == 1){
- c++;
- }
- }
- cout << c << endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |