結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー kotatsugamekotatsugame
提出日時 2020-02-23 07:40:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 176 ms / 4,000 ms
コード長 790 bytes
コンパイル時間 1,040 ms
コンパイル使用メモリ 85,480 KB
実行使用メモリ 12,256 KB
最終ジャッジ日時 2024-04-18 08:24:19
合計ジャッジ時間 7,998 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
11,120 KB
testcase_01 AC 133 ms
11,072 KB
testcase_02 AC 110 ms
10,816 KB
testcase_03 AC 133 ms
10,896 KB
testcase_04 AC 133 ms
10,832 KB
testcase_05 AC 125 ms
10,772 KB
testcase_06 AC 176 ms
12,256 KB
testcase_07 AC 114 ms
11,172 KB
testcase_08 AC 111 ms
11,760 KB
testcase_09 AC 114 ms
11,360 KB
testcase_10 AC 122 ms
11,364 KB
testcase_11 AC 137 ms
10,980 KB
testcase_12 AC 124 ms
10,552 KB
testcase_13 AC 95 ms
11,292 KB
testcase_14 AC 108 ms
10,512 KB
testcase_15 AC 89 ms
11,620 KB
testcase_16 AC 136 ms
11,364 KB
testcase_17 AC 137 ms
11,492 KB
testcase_18 AC 138 ms
11,368 KB
testcase_19 AC 97 ms
11,236 KB
testcase_20 AC 100 ms
10,684 KB
testcase_21 AC 102 ms
11,104 KB
testcase_22 AC 136 ms
11,368 KB
testcase_23 AC 116 ms
11,360 KB
testcase_24 AC 95 ms
11,364 KB
testcase_25 AC 121 ms
10,980 KB
testcase_26 AC 105 ms
11,620 KB
testcase_27 AC 127 ms
11,040 KB
testcase_28 AC 95 ms
11,364 KB
testcase_29 AC 130 ms
11,492 KB
testcase_30 AC 17 ms
8,268 KB
testcase_31 AC 24 ms
8,324 KB
testcase_32 AC 139 ms
10,544 KB
testcase_33 AC 151 ms
11,108 KB
testcase_34 AC 116 ms
11,612 KB
testcase_35 AC 19 ms
8,268 KB
testcase_36 AC 30 ms
8,268 KB
testcase_37 AC 17 ms
8,272 KB
testcase_38 AC 20 ms
8,160 KB
testcase_39 AC 24 ms
8,152 KB
testcase_40 AC 16 ms
8,428 KB
testcase_41 AC 23 ms
8,456 KB
testcase_42 AC 23 ms
8,764 KB
testcase_43 AC 24 ms
8,728 KB
testcase_44 AC 22 ms
8,144 KB
testcase_45 AC 18 ms
8,424 KB
testcase_46 AC 33 ms
8,448 KB
testcase_47 AC 38 ms
8,748 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N,K;
vector<pair<pair<int,int>,int> >S[11];
int cnt[1<<17];
main()
{
	cin>>N>>K;
	vector<int>ans;
	for(int i=0;i<N;i++)
	{
		int s,p,u;cin>>s>>p>>u;
		S[s].push_back(make_pair(make_pair(p,u),i));
	}
	for(int i=10;i>=0;i--)
	{
		vector<vector<pair<int,int> > >U(100000),P(100000);
		for(pair<pair<int,int>,int>p:S[i])
		{
			U[p.first.second-1].push_back(make_pair(p.first.first,p.second));
		}
		for(int k=0;k<100000;k++)
		{
			sort(U[k].begin(),U[k].end());
			for(int j=0;j<U[k].size();j++)
			{
				P[cnt[k]++].push_back(U[k][j]);
			}
		}
		for(vector<pair<int,int> >&p:P)
		{
			sort(p.begin(),p.end());
			for(pair<int,int>q:p)ans.push_back(q.second);
		}
	}
	for(int i=0;i<K;i++)cout<<ans[i]<<endl;
}
0