#46085: cpp 超級簡單解


1121232@stu.wghs.tp.edu.tw (Ian911436)

學校 : 臺北市私立薇閣高級中學
編號 : 258883
來源 : [60.248.154.143]
最後登入時間 :
2025-06-20 09:40:35

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int n, m, sum = 0;
cin >> n >> m;
string a[n], b[m];
for(int i=0; i < n; i++){
    cin >> a[i];
}
for(int i=0; i < m; i++){
    cin >> b[i];
}
for(int i=0; i < n; i++){
    for(int j=0; j < m; j++){
        if(a[i]==b[j]){
            sum ++;
        }
    }
}
    cout << n-sum;
    return 0;
}