You are viewing a single comment's thread. Return to all comments →
For the c++ folks
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); int str_c,q_c; map<string,int> m; string s; cin>>str_c; while( str_c-- ){ cin>>s; m[s] += 1; } cin>>q_c; while ( q_c-- ) { cin>>s; cout<<m[s]<<"\n"; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
For the c++ folks