結果

問題 No.945 YKC饅頭
ユーザー 00 Sakuda00 Sakuda
提出日時 2024-04-05 00:15:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 266 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 2,760 ms
コンパイル使用メモリ 210,612 KB
実行使用メモリ 13,928 KB
最終ジャッジ日時 2024-04-05 00:16:05
合計ジャッジ時間 13,080 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 3 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 3 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 3 ms
6,676 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 AC 3 ms
6,676 KB
testcase_25 AC 2 ms
6,676 KB
testcase_26 AC 3 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 2 ms
6,676 KB
testcase_30 AC 2 ms
6,676 KB
testcase_31 AC 17 ms
6,676 KB
testcase_32 AC 48 ms
9,728 KB
testcase_33 AC 78 ms
10,112 KB
testcase_34 AC 103 ms
8,320 KB
testcase_35 AC 180 ms
12,416 KB
testcase_36 AC 97 ms
6,676 KB
testcase_37 AC 92 ms
6,676 KB
testcase_38 AC 90 ms
6,676 KB
testcase_39 AC 48 ms
7,936 KB
testcase_40 AC 70 ms
10,752 KB
testcase_41 AC 41 ms
8,448 KB
testcase_42 AC 135 ms
7,936 KB
testcase_43 AC 84 ms
6,676 KB
testcase_44 AC 142 ms
10,880 KB
testcase_45 AC 146 ms
6,784 KB
testcase_46 AC 26 ms
6,912 KB
testcase_47 AC 106 ms
8,704 KB
testcase_48 AC 21 ms
6,676 KB
testcase_49 AC 66 ms
8,448 KB
testcase_50 AC 152 ms
7,552 KB
testcase_51 AC 216 ms
13,056 KB
testcase_52 AC 219 ms
13,312 KB
testcase_53 AC 211 ms
13,056 KB
testcase_54 AC 218 ms
13,312 KB
testcase_55 AC 213 ms
13,056 KB
testcase_56 AC 80 ms
13,928 KB
testcase_57 AC 64 ms
13,056 KB
testcase_58 AC 235 ms
12,800 KB
testcase_59 AC 259 ms
12,800 KB
testcase_60 AC 158 ms
12,800 KB
testcase_61 AC 266 ms
12,800 KB
testcase_62 AC 241 ms
12,800 KB
testcase_63 AC 64 ms
12,800 KB
testcase_64 AC 167 ms
12,800 KB
testcase_65 AC 152 ms
12,800 KB
testcase_66 AC 145 ms
12,800 KB
testcase_67 AC 201 ms
12,800 KB
testcase_68 AC 162 ms
12,800 KB
testcase_69 AC 121 ms
12,800 KB
testcase_70 AC 107 ms
12,800 KB
testcase_71 AC 109 ms
12,800 KB
testcase_72 AC 182 ms
12,800 KB
testcase_73 AC 252 ms
12,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
	int N, M;cin >> N >> M;
	set<int> non;
	for (int i = 1;i <= N;i++) non.insert(i);
	vector<int> ans(3, 0);
	while (M--) {
		int l, r;char c;cin >> l >> r >> c;
		int v = 0;
		if (c == 'K') {
			v = 1;
		} else if (c == 'C') {
			v = 2;
		}
		auto itr = non.lower_bound(l);
		vector<int> er;
		while (itr != non.end()) {
			if (*itr > r) break;
			er.push_back(*itr);
			itr++;
		}
		for (auto nv : er) non.erase(nv);
		ans[v] += (int)er.size();
	}
	cout << ans[0] << " "<< ans[1] << " " << ans[2] << endl;
}
0