結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー furafura
提出日時 2020-07-31 00:27:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 48 ms / 4,000 ms
コード長 568 bytes
コンパイル時間 2,418 ms
コンパイル使用メモリ 213,428 KB
実行使用メモリ 5,552 KB
最終ジャッジ日時 2023-09-18 09:08:24
合計ジャッジ時間 6,686 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
5,072 KB
testcase_01 AC 44 ms
5,552 KB
testcase_02 AC 44 ms
5,200 KB
testcase_03 AC 45 ms
5,176 KB
testcase_04 AC 46 ms
5,260 KB
testcase_05 AC 44 ms
5,268 KB
testcase_06 AC 48 ms
5,016 KB
testcase_07 AC 43 ms
5,272 KB
testcase_08 AC 45 ms
4,848 KB
testcase_09 AC 46 ms
4,984 KB
testcase_10 AC 45 ms
4,892 KB
testcase_11 AC 45 ms
4,720 KB
testcase_12 AC 45 ms
5,368 KB
testcase_13 AC 43 ms
4,992 KB
testcase_14 AC 43 ms
5,248 KB
testcase_15 AC 41 ms
4,796 KB
testcase_16 AC 45 ms
4,984 KB
testcase_17 AC 46 ms
4,872 KB
testcase_18 AC 46 ms
4,836 KB
testcase_19 AC 44 ms
4,992 KB
testcase_20 AC 43 ms
5,304 KB
testcase_21 AC 43 ms
4,972 KB
testcase_22 AC 46 ms
4,840 KB
testcase_23 AC 45 ms
4,884 KB
testcase_24 AC 43 ms
4,836 KB
testcase_25 AC 46 ms
4,868 KB
testcase_26 AC 42 ms
4,824 KB
testcase_27 AC 45 ms
4,872 KB
testcase_28 AC 43 ms
4,916 KB
testcase_29 AC 45 ms
5,032 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 47 ms
5,396 KB
testcase_33 AC 48 ms
4,980 KB
testcase_34 AC 46 ms
4,840 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 2 ms
4,376 KB
testcase_40 AC 2 ms
4,380 KB
testcase_41 AC 5 ms
4,376 KB
testcase_42 AC 6 ms
4,380 KB
testcase_43 AC 5 ms
4,376 KB
testcase_44 AC 5 ms
4,376 KB
testcase_45 AC 2 ms
4,380 KB
testcase_46 AC 6 ms
4,380 KB
testcase_47 AC 6 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int n,k; scanf("%d%d",&n,&k);
	vector<vector<tuple<int,int,int>>> a(11);
	rep(i,n){
		int x,p,u; scanf("%d%d%d",&x,&p,&u); u--;
		a[x].emplace_back(u,p,i);
	}

	vector<int> cnt(100000);
	for(int x=10;x>=0;x--){
		sort(a[x].begin(),a[x].end(),[](auto p,auto q){
			return get<1>(p)<get<1>(q);
		});
		for(auto& t:a[x]) get<0>(t)=cnt[get<0>(t)]++;
		sort(a[x].begin(),a[x].end());
		for(auto t:a[x]) if(k>0) {
			printf("%d\n",get<2>(t));
			k--;
		}
	}

	return 0;
}
0