Berland National Library
来源:互联网 发布:台湾艺人知乎 编辑:程序博客网 时间:2024/06/06 16:57
#include<iostream> #include<set> #include<cstdio> using namespace std; int main() { set<int> s; int num=0; char c;int k,n; cin>>n; for(int i=0;i<n;i++) { cin>>c>>k; if(c=='+') { s.insert(k); int l=s.size(); num=max(l,num); } else { if(s.find(k)==s.end()) num++; else s.erase(k); int l=s.size(); num=max(l,num); } } cout<<num<<endl; return 0;}
注意:1,虽然是模拟题但是可以不用模拟。
0 0
- Berland National Library
- B. Berland National Library
- Berland National Library
- Berland National Library
- CodeForces 567- Berland National Library
- Codeforces B - Berland National Library
- 模拟 codeforces567B Berland National Library
- Codeforces 567B Berland National Library
- Codeforces 567 B. Berland National Library
- Code Forces 567B Berland National Library
- Berland National Library(模拟题目)
- CodeForces 567B Berland National Library
- CodeForces 567B Berland National Library
- CodeForces 567B Berland National Library
- CodeForces - 567B Berland National Library
- CodeForces-567B Berland National Library
- CodeForces 567B-Berland National Library
- CodeForces 567B Berland National Library
- iOS获取camera的yuv数据
- Eclipse快捷键整理
- MoviePlayerViewController
- Ubuntu配置静态IP
- Python练习-- List Comprehensions
- Berland National Library
- gcc与g++编译链接库文件兼容性
- Linux下安装maven
- iOS 开发 -- Swift 语法篇 (三) 控制流
- Python——运算符重载(2)
- Log4j使用及配置
- 源代码管理工具SVN的使用(三)(命令行)
- AngularJS如何下载Excel文件
- 基于Servlet&Jsp的网上书店设计(二)