complete 1764.cpp 10816.cpp 25793.kt

This commit is contained in:
yenru0 committed 2025-09-08 17:15:00 +09:00
1 parent f18ae8d149
commit 603f94f8d8
3 files changed
+133

No files matched your search

+42
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";
}