2 条题解
-
0
这道题其实用 的 函数就行,因为没有删除操作,只有增加操作。 函数太慢了。
#include<bits/stdc++.h> using namespace std; unordered_map<string,bool>mp; string op,str; inline void solve() { cin>>op;getline(cin,str); if(op[0]=='a')mp[str]=0; else { if(mp.find(str)!=mp.end())puts("yes"); else puts("no"); } } int main() { ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); int n;cin>>n; for(int i=1;i<=n;i++)solve(); return 0; }
- 1
信息
- ID
- 66
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 7
- 标签
- 递交数
- 187
- 已通过
- 46
- 上传者