|
|
back to boardError in 4th test Posted by Iskhak 5 May 2018 06:49 What's wrong in this code? #include <bits/stdc++.h> using namespace std; int main () { setlocale(LC_ALL, "Russian"); ios_base::sync_with_stdio(false); cin.tie(NULL); string k; map <int,int> mp; int i,j,m,n,s=0; cin>>n; for (i=0;i<n;i++){ cin>>j; mp[j]=1; } cin>>m; for (i=0;i<m;i++){ cin>>s; if (mp[s]>=1) mp[s]++; } int d=0; for (auto q:mp){ if (q.second>1) cout<<q.second-1<<endl; else d++; } if (d==mp.size()) cout<<0<<endl; } |
|
|