結果

問題 No.945 YKC饅頭
ユーザー 👑 kmjpkmjp
提出日時 2019-12-08 00:16:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 358 ms / 2,000 ms
コード長 1,138 bytes
コンパイル時間 1,803 ms
コンパイル使用メモリ 176,632 KB
実行使用メモリ 25,628 KB
最終ジャッジ日時 2023-08-27 07:13:25
合計ジャッジ時間 10,661 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,940 KB
testcase_01 AC 6 ms
12,884 KB
testcase_02 AC 6 ms
12,908 KB
testcase_03 AC 7 ms
12,948 KB
testcase_04 AC 6 ms
12,852 KB
testcase_05 AC 6 ms
13,024 KB
testcase_06 AC 7 ms
12,900 KB
testcase_07 AC 7 ms
12,992 KB
testcase_08 AC 7 ms
13,036 KB
testcase_09 AC 7 ms
12,860 KB
testcase_10 AC 7 ms
13,064 KB
testcase_11 AC 7 ms
12,844 KB
testcase_12 AC 7 ms
12,860 KB
testcase_13 AC 7 ms
12,948 KB
testcase_14 AC 7 ms
12,920 KB
testcase_15 AC 7 ms
12,880 KB
testcase_16 AC 7 ms
12,840 KB
testcase_17 AC 7 ms
12,900 KB
testcase_18 AC 7 ms
12,868 KB
testcase_19 AC 7 ms
12,940 KB
testcase_20 AC 6 ms
13,016 KB
testcase_21 AC 6 ms
12,952 KB
testcase_22 AC 7 ms
13,156 KB
testcase_23 AC 7 ms
12,988 KB
testcase_24 AC 7 ms
13,000 KB
testcase_25 AC 7 ms
12,884 KB
testcase_26 AC 7 ms
12,880 KB
testcase_27 AC 7 ms
12,824 KB
testcase_28 AC 7 ms
12,812 KB
testcase_29 AC 7 ms
12,816 KB
testcase_30 AC 6 ms
12,868 KB
testcase_31 AC 14 ms
13,520 KB
testcase_32 AC 8 ms
12,952 KB
testcase_33 AC 51 ms
15,776 KB
testcase_34 AC 147 ms
19,492 KB
testcase_35 AC 267 ms
23,476 KB
testcase_36 AC 198 ms
20,272 KB
testcase_37 AC 181 ms
19,724 KB
testcase_38 AC 161 ms
19,792 KB
testcase_39 AC 32 ms
14,564 KB
testcase_40 AC 26 ms
14,172 KB
testcase_41 AC 12 ms
13,280 KB
testcase_42 AC 254 ms
22,292 KB
testcase_43 AC 163 ms
19,548 KB
testcase_44 AC 195 ms
21,308 KB
testcase_45 AC 281 ms
23,304 KB
testcase_46 AC 7 ms
12,928 KB
testcase_47 AC 146 ms
19,532 KB
testcase_48 AC 28 ms
14,340 KB
testcase_49 AC 54 ms
15,920 KB
testcase_50 AC 299 ms
23,980 KB
testcase_51 AC 337 ms
25,420 KB
testcase_52 AC 340 ms
25,444 KB
testcase_53 AC 358 ms
25,628 KB
testcase_54 AC 349 ms
25,436 KB
testcase_55 AC 358 ms
25,440 KB
testcase_56 AC 7 ms
12,876 KB
testcase_57 AC 7 ms
12,956 KB
testcase_58 AC 124 ms
19,216 KB
testcase_59 AC 157 ms
20,204 KB
testcase_60 AC 54 ms
16,224 KB
testcase_61 AC 136 ms
19,492 KB
testcase_62 AC 128 ms
19,208 KB
testcase_63 AC 9 ms
12,932 KB
testcase_64 AC 58 ms
16,216 KB
testcase_65 AC 46 ms
15,568 KB
testcase_66 AC 44 ms
15,444 KB
testcase_67 AC 90 ms
17,768 KB
testcase_68 AC 55 ms
16,032 KB
testcase_69 AC 20 ms
13,872 KB
testcase_70 AC 25 ms
14,432 KB
testcase_71 AC 26 ms
14,200 KB
testcase_72 AC 75 ms
16,864 KB
testcase_73 AC 147 ms
19,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------


int N,M;
vector<pair<int,char>> add[202020];
vector<pair<int,char>> del[202020];

int cnt[256];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>M;
	FOR(i,M) {
		cin>>x>>y>>s;
		add[x].push_back({i,s[0]});
		del[y+1].push_back({i,s[0]});
	}
	
	set<pair<int,int>> S;
	S.insert({505050,'a'});
	for(i=1;i<=N;i++) {
		FORR(a,add[i]) S.insert(a);
		FORR(a,del[i]) S.erase(a);
		cnt[S.begin()->second]++;
	}
	cout<<cnt['Y']<<" "<<cnt['K']<<" "<<cnt['C']<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0