結果

問題 No.945 YKC饅頭
ユーザー okkuukenkenokkuukenken
提出日時 2022-07-17 19:02:47
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 378 ms / 2,000 ms
コード長 698 bytes
コンパイル時間 1,444 ms
コンパイル使用メモリ 137,988 KB
実行使用メモリ 24,892 KB
最終ジャッジ日時 2023-09-12 07:11:10
合計ジャッジ時間 12,704 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 4 ms
4,380 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 4 ms
4,376 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 4 ms
4,376 KB
testcase_10 AC 4 ms
4,376 KB
testcase_11 AC 4 ms
4,380 KB
testcase_12 AC 3 ms
4,380 KB
testcase_13 AC 4 ms
4,376 KB
testcase_14 AC 4 ms
4,380 KB
testcase_15 AC 3 ms
4,376 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 AC 4 ms
4,380 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 AC 3 ms
4,376 KB
testcase_20 AC 3 ms
4,380 KB
testcase_21 AC 4 ms
4,376 KB
testcase_22 AC 4 ms
4,380 KB
testcase_23 AC 4 ms
4,380 KB
testcase_24 AC 4 ms
4,380 KB
testcase_25 AC 4 ms
4,376 KB
testcase_26 AC 4 ms
4,380 KB
testcase_27 AC 3 ms
4,376 KB
testcase_28 AC 3 ms
4,380 KB
testcase_29 AC 3 ms
4,376 KB
testcase_30 AC 3 ms
4,380 KB
testcase_31 AC 15 ms
5,660 KB
testcase_32 AC 10 ms
7,740 KB
testcase_33 AC 66 ms
12,756 KB
testcase_34 AC 168 ms
14,264 KB
testcase_35 AC 293 ms
22,020 KB
testcase_36 AC 204 ms
9,984 KB
testcase_37 AC 188 ms
9,808 KB
testcase_38 AC 173 ms
11,008 KB
testcase_39 AC 36 ms
9,316 KB
testcase_40 AC 32 ms
11,596 KB
testcase_41 AC 15 ms
8,316 KB
testcase_42 AC 253 ms
16,232 KB
testcase_43 AC 168 ms
8,820 KB
testcase_44 AC 214 ms
18,236 KB
testcase_45 AC 292 ms
15,644 KB
testcase_46 AC 7 ms
6,196 KB
testcase_47 AC 171 ms
14,620 KB
testcase_48 AC 33 ms
5,540 KB
testcase_49 AC 66 ms
11,204 KB
testcase_50 AC 312 ms
16,848 KB
testcase_51 AC 372 ms
24,768 KB
testcase_52 AC 374 ms
24,832 KB
testcase_53 AC 377 ms
24,772 KB
testcase_54 AC 378 ms
24,776 KB
testcase_55 AC 359 ms
24,892 KB
testcase_56 AC 4 ms
4,376 KB
testcase_57 AC 4 ms
4,376 KB
testcase_58 AC 166 ms
19,144 KB
testcase_59 AC 207 ms
20,080 KB
testcase_60 AC 76 ms
15,860 KB
testcase_61 AC 176 ms
19,328 KB
testcase_62 AC 172 ms
19,116 KB
testcase_63 AC 13 ms
10,708 KB
testcase_64 AC 80 ms
16,212 KB
testcase_65 AC 66 ms
15,480 KB
testcase_66 AC 63 ms
15,384 KB
testcase_67 AC 126 ms
17,756 KB
testcase_68 AC 81 ms
16,248 KB
testcase_69 AC 33 ms
13,844 KB
testcase_70 AC 40 ms
14,156 KB
testcase_71 AC 39 ms
14,124 KB
testcase_72 AC 100 ms
16,980 KB
testcase_73 AC 198 ms
19,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<random>
using namespace std;
typedef long long ll;
const int mod=998244353;
vector<int>in[200001],out[200001];
int cnt[128];
int main(){
	int n,m,l,r;
	static char t[200000];
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>l>>r>>t[i];
		in[l-1].push_back(i);
		out[r].push_back(i);
	}
	set<int>st;
	for(int i=0;i<n;i++){
		for(auto x:in[i])
			st.insert(x);
		for(auto x:out[i])
			st.erase(x);
		if(st.size())
			cnt[t[*st.begin()]]++;
	}
	cout<<cnt['Y']<<' '<<cnt['K']<<' '<<cnt['C']<<endl;
}
0