結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー guestguest
提出日時 2016-10-15 19:00:35
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 48 ms / 4,000 ms
コード長 1,054 bytes
コンパイル時間 971 ms
コンパイル使用メモリ 83,332 KB
実行使用メモリ 5,384 KB
最終ジャッジ日時 2023-08-14 14:11:25
合計ジャッジ時間 4,740 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
4,900 KB
testcase_01 AC 46 ms
4,896 KB
testcase_02 AC 47 ms
4,844 KB
testcase_03 AC 48 ms
4,808 KB
testcase_04 AC 45 ms
4,796 KB
testcase_05 AC 46 ms
4,816 KB
testcase_06 AC 47 ms
4,796 KB
testcase_07 AC 46 ms
4,808 KB
testcase_08 AC 46 ms
4,848 KB
testcase_09 AC 48 ms
5,308 KB
testcase_10 AC 46 ms
4,852 KB
testcase_11 AC 44 ms
5,384 KB
testcase_12 AC 47 ms
4,896 KB
testcase_13 AC 41 ms
4,800 KB
testcase_14 AC 41 ms
4,792 KB
testcase_15 AC 38 ms
4,884 KB
testcase_16 AC 42 ms
4,904 KB
testcase_17 AC 46 ms
4,804 KB
testcase_18 AC 45 ms
4,892 KB
testcase_19 AC 40 ms
4,804 KB
testcase_20 AC 43 ms
4,800 KB
testcase_21 AC 43 ms
4,852 KB
testcase_22 AC 43 ms
5,344 KB
testcase_23 AC 43 ms
4,900 KB
testcase_24 AC 42 ms
4,896 KB
testcase_25 AC 45 ms
4,844 KB
testcase_26 AC 42 ms
4,852 KB
testcase_27 AC 44 ms
4,920 KB
testcase_28 AC 42 ms
4,804 KB
testcase_29 AC 41 ms
4,896 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 46 ms
4,856 KB
testcase_33 AC 45 ms
4,820 KB
testcase_34 AC 47 ms
4,840 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 1 ms
4,380 KB
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 1 ms
4,380 KB
testcase_39 AC 2 ms
4,380 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 5 ms
4,380 KB
testcase_42 AC 4 ms
4,380 KB
testcase_43 AC 5 ms
4,376 KB
testcase_44 AC 5 ms
4,380 KB
testcase_45 AC 2 ms
4,376 KB
testcase_46 AC 6 ms
4,380 KB
testcase_47 AC 6 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <array>
#include <cmath>

#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; 
typedef array<int, 5> A5;

int main()
{
	
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n, k;
	cin >> n >> k;
	vector<A5> dt(n);
	rep(i,n){
		cin >> dt[i][0] >> dt[i][1] >> dt[i][2] ;
		dt[i][3] = i;
	}
	sort(all(dt),[](A5 l,A5 r){
		return l[2] !=r[2]? l[2] < r[2]: l[0] !=r[0]? l[0] > r[0] : l[1] < r[1];
	});
	dt[0][4]=1;
	rep(i,n-1) dt[i+1][4] = (dt[i][2] == dt[i+1][2])?  dt[i][4] + 1: 1;

	//for(auto xl: dt){for(auto x :xl) printf("%d: ",x); puts("");}
	sort(all(dt),[](A5 l,A5 r){
		return l[0] !=r[0]? l[0] > r[0]: l[4] !=r[4]? l[4] < r[4] : l[1] < r[1];
	});
	//for(auto xl: dt){for(auto x :xl) printf("%d: ",x); puts("");}

	rep(i,k) cout << dt[i][3] <<"\n";
	return 0;
}
0