結果

問題 No.945 YKC饅頭
ユーザー kotatsugamekotatsugame
提出日時 2019-12-09 02:18:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 942 ms
コンパイル使用メモリ 76,320 KB
実行使用メモリ 17,628 KB
最終ジャッジ日時 2023-09-01 03:59:00
合計ジャッジ時間 8,774 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
9,652 KB
testcase_01 AC 5 ms
9,532 KB
testcase_02 AC 5 ms
9,512 KB
testcase_03 AC 6 ms
9,600 KB
testcase_04 AC 4 ms
9,676 KB
testcase_05 AC 5 ms
9,516 KB
testcase_06 AC 5 ms
9,500 KB
testcase_07 AC 5 ms
9,488 KB
testcase_08 AC 5 ms
9,520 KB
testcase_09 AC 5 ms
9,480 KB
testcase_10 AC 5 ms
9,476 KB
testcase_11 AC 4 ms
9,472 KB
testcase_12 AC 5 ms
9,480 KB
testcase_13 AC 5 ms
9,520 KB
testcase_14 AC 5 ms
9,696 KB
testcase_15 AC 4 ms
9,496 KB
testcase_16 AC 5 ms
9,528 KB
testcase_17 AC 5 ms
9,612 KB
testcase_18 AC 5 ms
9,504 KB
testcase_19 AC 5 ms
9,460 KB
testcase_20 AC 4 ms
9,512 KB
testcase_21 AC 5 ms
9,576 KB
testcase_22 AC 5 ms
9,700 KB
testcase_23 AC 5 ms
9,508 KB
testcase_24 AC 5 ms
9,488 KB
testcase_25 AC 6 ms
9,504 KB
testcase_26 AC 5 ms
9,512 KB
testcase_27 AC 4 ms
9,556 KB
testcase_28 AC 4 ms
9,684 KB
testcase_29 AC 4 ms
9,492 KB
testcase_30 AC 4 ms
9,508 KB
testcase_31 AC 12 ms
9,908 KB
testcase_32 AC 6 ms
9,636 KB
testcase_33 AC 39 ms
11,176 KB
testcase_34 AC 94 ms
13,144 KB
testcase_35 AC 180 ms
16,096 KB
testcase_36 AC 115 ms
15,784 KB
testcase_37 AC 110 ms
15,512 KB
testcase_38 AC 105 ms
13,360 KB
testcase_39 AC 27 ms
10,344 KB
testcase_40 AC 21 ms
10,268 KB
testcase_41 AC 10 ms
9,788 KB
testcase_42 AC 143 ms
15,968 KB
testcase_43 AC 97 ms
16,780 KB
testcase_44 AC 119 ms
13,844 KB
testcase_45 AC 158 ms
16,328 KB
testcase_46 AC 6 ms
9,544 KB
testcase_47 AC 95 ms
13,072 KB
testcase_48 AC 24 ms
10,356 KB
testcase_49 AC 45 ms
11,204 KB
testcase_50 AC 160 ms
16,940 KB
testcase_51 AC 213 ms
16,620 KB
testcase_52 AC 217 ms
16,588 KB
testcase_53 AC 193 ms
16,624 KB
testcase_54 AC 184 ms
16,676 KB
testcase_55 AC 214 ms
17,628 KB
testcase_56 AC 5 ms
9,436 KB
testcase_57 AC 5 ms
9,560 KB
testcase_58 AC 127 ms
12,692 KB
testcase_59 AC 158 ms
13,312 KB
testcase_60 AC 55 ms
11,016 KB
testcase_61 AC 139 ms
12,860 KB
testcase_62 AC 129 ms
12,792 KB
testcase_63 AC 7 ms
9,560 KB
testcase_64 AC 66 ms
11,168 KB
testcase_65 AC 47 ms
11,032 KB
testcase_66 AC 45 ms
10,724 KB
testcase_67 AC 94 ms
12,012 KB
testcase_68 AC 56 ms
11,052 KB
testcase_69 AC 20 ms
9,988 KB
testcase_70 AC 25 ms
10,132 KB
testcase_71 AC 26 ms
10,200 KB
testcase_72 AC 72 ms
11,556 KB
testcase_73 AC 149 ms
13,156 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<queue>
using namespace std;
int N,M;
vector<pair<int,pair<int,int> > >A[2<<17];
main()
{
	cin>>N>>M;
	for(int i=0;i<M;i++)
	{
		int L,R;char c;cin>>L>>R>>c;
		A[L-1].push_back(make_pair(i,make_pair(R,c=='Y'?0:c=='K'?1:2)));
	}
	priority_queue<pair<int,pair<int,int> > >P;
	int ans[3]={};
	for(int i=0;i<N;i++)
	{
		for(pair<int,pair<int,int> >p:A[i])
		{
			P.push(make_pair(-p.first,p.second));
		}
		while(!P.empty()&&P.top().second.first<=i)P.pop();
		if(!P.empty())
		{
			ans[P.top().second.second]++;
		}
	}
	cout<<ans[0]<<" "<<ans[1]<<" "<<ans[2]<<endl;
}
0