You are viewing a single comment's thread. Return to all comments →
using namespace std;
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int queries; cin>>queries; mapmp;
while(queries--) { string str; getline(cin>>ws,str); stringstream ss(str); int choice; ss >> choice; switch(choice) { case 1: { string name; int num; ss>>name>>num; mp[name] += num; break; } case 2: { string name = str.substr(2); mp.erase(name); break; } case 3: { string name = str.substr(2); cout<<mp[name]<<"\n"; break; } } } return 0;
}
This code of mine runs successfully across every platforms i tried running but doesn't run in hackerrank... Any idea ?
Seems like cookies are disabled on this browser, please enable them to open this website
Maps-STL
You are viewing a single comment's thread. Return to all comments →
include
using namespace std;
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */
int queries; cin>>queries; mapmp;
}
This code of mine runs successfully across every platforms i tried running but doesn't run in hackerrank... Any idea ?