結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー dnishdnish
提出日時 2017-07-01 16:33:44
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 169 ms / 4,000 ms
コード長 768 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 172,968 KB
実行使用メモリ 6,888 KB
最終ジャッジ日時 2024-04-15 10:58:46
合計ジャッジ時間 8,319 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
6,812 KB
testcase_01 AC 140 ms
6,884 KB
testcase_02 AC 113 ms
6,752 KB
testcase_03 AC 141 ms
6,760 KB
testcase_04 AC 141 ms
6,628 KB
testcase_05 AC 126 ms
6,628 KB
testcase_06 AC 169 ms
6,624 KB
testcase_07 AC 117 ms
6,756 KB
testcase_08 AC 112 ms
6,756 KB
testcase_09 AC 125 ms
6,628 KB
testcase_10 AC 128 ms
6,624 KB
testcase_11 AC 145 ms
6,628 KB
testcase_12 AC 137 ms
6,624 KB
testcase_13 AC 101 ms
6,756 KB
testcase_14 AC 118 ms
6,768 KB
testcase_15 AC 92 ms
6,628 KB
testcase_16 AC 154 ms
6,756 KB
testcase_17 AC 149 ms
6,632 KB
testcase_18 AC 154 ms
6,760 KB
testcase_19 AC 103 ms
6,756 KB
testcase_20 AC 113 ms
6,760 KB
testcase_21 AC 109 ms
6,760 KB
testcase_22 AC 139 ms
6,760 KB
testcase_23 AC 122 ms
6,760 KB
testcase_24 AC 103 ms
6,880 KB
testcase_25 AC 132 ms
6,756 KB
testcase_26 AC 109 ms
6,672 KB
testcase_27 AC 129 ms
6,888 KB
testcase_28 AC 101 ms
6,628 KB
testcase_29 AC 138 ms
6,752 KB
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 151 ms
6,628 KB
testcase_33 AC 156 ms
6,660 KB
testcase_34 AC 118 ms
6,752 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 3 ms
5,376 KB
testcase_40 AC 3 ms
5,376 KB
testcase_41 AC 12 ms
5,376 KB
testcase_42 AC 12 ms
5,376 KB
testcase_43 AC 11 ms
5,376 KB
testcase_44 AC 11 ms
5,376 KB
testcase_45 AC 4 ms
5,376 KB
testcase_46 AC 24 ms
5,376 KB
testcase_47 AC 24 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int) N;i++)
#define RREP(i,n,N) for(int i=N-1;i>=(int) n;i--)
#define p(s) cout<<(s)<<endl
#define DEBUG(x,y) cout<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl;
#define CK(n,a,b) ((a)<=(n)&&(n)<=(b))
#define F first
#define S second
typedef long long ll;
using namespace std;
const ll inf=1e9;

int N, K;
int S[100010], P[100010], U[100010];
int univ[100010];

int main(){
	cin>>N>>K;
	REP(i,0,N){
		cin>>S[i]>>P[i]>>U[i];
	}

	vector<pair< pair<int,int>, pair<int,int> > > v;
	REP(i,0,N){
		v.push_back({{-S[i],0},{P[i], i}});
	}
	sort(v.begin(), v.end());


	REP(i,0,N){
		univ[U[v[i].S.S]]++;
		v[i].F.S = univ[U[v[i].S.S]];
	}
	sort(v.begin(), v.end());

	REP(i,0,K){
		cout<<v[i].S.S<<endl;
	}

	return 0;
}
0