voidsolve() { int n, m; cin >> n >> m; int a[2000] = {0}; for (int i = 0; i < n; ++i) { char s; cin >> s; int num = s - 'A'; a[num] += 1; } int ans = 0; for (int i = 0; i < 7; ++i) { if (m - a[i] > 0) ans += m - a[i]; } cout << ans << endl; }
voidsolve() { int n; cin >> n; vector<int> ann(n); vector<int> bnn(n); for (int i = 0; i < n; ++i) { cin >> ann[i]; } for (int i = 0; i < n; ++i) { cin >> bnn[i]; } int m; cin >> m; vector<int> cnn(m); for (int i = 0; i < m; ++i) { cin >> cnn[i]; } map<int, int> mp; for (int i = 0; i < n; ++i) { mp[bnn[i]]++; } if (mp[cnn[m - 1]] == 0) { cout << "NO" << endl; return; } map<int, int> mp2; for (int i = 0; i < n; ++i) { if (ann[i] != bnn[i]) { mp2[bnn[i]]++; } } for (int i = m - 1; i >= 0; --i) { if (mp2[cnn[i]] != 0) { mp2[cnn[i]]--; } }