Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) B. T-shirt buying
来源:互联网 发布:网络通信协议图 编辑:程序博客网 时间:2024/05/21 06:41
直接stl水过。用set。做完第一个题用了一个半小时多,第二个题用了十几分钟,然后两个小时基本就没了,也没再看后边的题目。
#include <iostream>#include <algorithm>#include <set>using namespace std;const int MAXN = 200010;int num[MAXN];set<int> sets[4];int main(){ ios::sync_with_stdio(false); int n,col,m,nm; cin >> n; for(int i = 1; i <= n; ++i) cin >> num[i]; for(int i = 1; i <= n; ++i) { cin >> col; sets[col].insert(num[i]); } for(int i = 1; i <= n; ++i) { cin >> col; sets[col].insert(num[i]); } cin >> m; for(int i = 0; i < m; ++i) { cin >> col; if(!sets[col].empty()) { nm = *(sets[col].begin()); cout << nm << endl; sets[1].erase(nm); sets[2].erase(nm); sets[3].erase(nm); } else cout << -1 << endl; } return 0;}
0 0
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) B. T-shirt buying
- codeforcesPlayrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2)B题B. T-shirt buying
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) B
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C. Fountains(树状数组)
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C Fountains 乱搞
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C Fountains
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) A. Carrot Cakes
- [Updating] Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) 解题报告
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) A题
- codeforcesPlayrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2)A题
- CodeforcesPlayrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2)C题C. Fountains
- Codeforces Round #413 Div. 1 + Div. 2 B. T-shirt buying
- Codeforces Round #413 (Div.1 + Div. 2) B. T-shirt buying
- codeforces Round #413 Div. 1 + Div. 2 B T-shirt buying
- Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) B. T-Shirt Hunt(模拟)
- Codeforces Round #413 B. T-shirt buying
- Codeforces Round #413 B. T-shirt buying
- (Codeforces Round #413, rated, Div. 1 + Div. 2)(A+B)
- HTTP自定义Header-(SOCKET-TCP)
- 7 复用类
- opencv SVM训练与mysql查询
- 【转】python--pyqt窗体背景透明的两种应用
- [模板]
- Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) B. T-shirt buying
- 8 多态
- 9 接口
- 文件读取工具类
- According to TLD or attribute directive in tag file, attribute var does not accept any expressions
- #AR游戏--音之国度#初次简单的测试
- 八种排序算法(直接插入,希尔,直接选择,堆,冒泡,快排,归并,基数)
- 10 内部类
- 软件工程-2.软件可行性研究