10个WA求助贴

学术版

@[gao_shou](/user/1034531) ```cpp //Author:Kevin Z K Y #include <bits/stdc++.h> #define up(a,b,c) for(int (a)=(b);(a)<=(c);(a)++) #define dn(a,b,c) for(int (a)=(b);(a)>=(c);(a)--) using namespace std; namespace my{ const int N=(int)(1e5+5); string ot; int a[N]; unordered_map<int,int>mp; void solve(){ int n;cin>>n; up(i,1,n)cin>>a[i],mp[a[i]]++; int _; cin>>_; while(_--){ int x;cin>>x; if(mp.find(x)==mp.end())cout<<'0'<<'\n'; else cout<<mp[x]<<'\n'; } } } int main(){ ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); int _=1; while(_--)my::solve();return 0; } ```
by kevinZ99 @ 2024-04-13 10:25:38


|