complete 1764.cpp 10816.cpp 25793.kt

This commit is contained in:
2025-09-08 17:14:06 +09:00
parent f18ae8d149
commit 603f94f8d8
3 changed files with 133 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
#include <map>
#include <iostream>
using namespace std;
void fastio() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
int main() {
fastio();
int n;
cin >> n;
map<int, int> ;
int x;
for (auto i = 0; i < n; i++) {
cin >> x;
auto pos = .find(x);
if (pos == .end()) {
[x] = 1;
} else {
pos->second++;
}
}
int m;
cin >> m;
for (auto i = 0; i < m; i++) {
cin >> x;
auto pos = .find(x);
if (pos == .end()) {
cout << "0 ";
} else {
cout << pos->second << " ";
}
}
cout << "\n";
}