1 条题解
-
1
#include<bits/stdc++.h> using namespace std; int t,s; int score; string name; map <string,int> a; int main(){ cin>>t; while(t--){ cin>>s; if(s==1){ cin>>name>>score; a[name]=score; cout<<"OK\n"; } else if(s==2){ cin>>name; if(a.find(name)!=a.end()){ cout<<a[name]<<"\n"; } else{ cout<<"Not found\n"; } } else if(s==3){ cin>>name; if(a.find(name)!=a.end()){ a.erase(a.find(name)); cout<<"Deleted successfully\n"; } else{ cout<<"Not found\n"; } } else{ cout<<a.size()<<"\n"; } } return 0; }
- 1
信息
- ID
- 9289
- 时间
- 1000ms
- 内存
- 125MiB
- 难度
- 5
- 标签
- (无)
- 递交数
- 24
- 已通过
- 10
- 上传者