結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー kurenai3110kurenai3110
提出日時 2016-10-15 08:25:46
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 995 bytes
コンパイル時間 864 ms
コンパイル使用メモリ 77,420 KB
実行使用メモリ 6,476 KB
最終ジャッジ日時 2024-05-02 01:51:16
合計ジャッジ時間 6,851 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 151 ms
6,352 KB
testcase_01 AC 132 ms
6,348 KB
testcase_02 AC 104 ms
6,092 KB
testcase_03 AC 134 ms
6,220 KB
testcase_04 AC 133 ms
5,964 KB
testcase_05 AC 118 ms
6,216 KB
testcase_06 AC 160 ms
6,476 KB
testcase_07 AC 107 ms
6,472 KB
testcase_08 AC 104 ms
6,224 KB
testcase_09 AC 119 ms
6,344 KB
testcase_10 AC 120 ms
5,964 KB
testcase_11 AC 137 ms
5,836 KB
testcase_12 AC 129 ms
6,096 KB
testcase_13 AC 95 ms
6,092 KB
testcase_14 AC 109 ms
5,960 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 147 ms
6,472 KB
testcase_18 AC 146 ms
6,072 KB
testcase_19 AC 96 ms
6,348 KB
testcase_20 AC 108 ms
6,092 KB
testcase_21 AC 102 ms
6,220 KB
testcase_22 AC 130 ms
5,964 KB
testcase_23 AC 114 ms
5,832 KB
testcase_24 AC 95 ms
6,220 KB
testcase_25 AC 128 ms
5,960 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 94 ms
6,220 KB
testcase_29 WA -
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 145 ms
6,092 KB
testcase_33 AC 153 ms
5,968 KB
testcase_34 AC 110 ms
6,352 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 11 ms
5,376 KB
testcase_42 AC 11 ms
5,376 KB
testcase_43 WA -
testcase_44 AC 11 ms
5,376 KB
testcase_45 AC 3 ms
5,376 KB
testcase_46 AC 24 ms
5,376 KB
testcase_47 AC 24 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;

struct ICPC {
	int s, p, u,num;

	bool operator<(const ICPC& right) const {
		if(u!=right.u) return u<right.u;
		if(s!=right.s) return s>right.s;
		return p<right.p;
	}
};

int Univ[100000];

int main()
{
	int n, k;
	cin >> n >> k;
	vector<ICPC> data;
	for (int i = 0; i < n; i++) {
		int s, p, u; cin >> s >> p >> u;
		ICPC icpc = { s,p,u,i };
		data.push_back(icpc);
	}
	sort(data.begin(), data.end());

	vector<pair<int,int> > pe_sort[11];
	for (int j = 0; j < data.size(); j++) {
		pe_sort[data[j].s].push_back(make_pair(data[j].p + Univ[data[j].u]*(int)1e6, data[j].num));
		Univ[data[j].u]++;
	}

	for (int i = 0; i < 11; i++) {
		sort(pe_sort[i].begin(), pe_sort[i].end());
	}

	int cnt = 0;
	for (int i = 10; i >= 0 ; i--) {
		for (int j = 0; j < pe_sort[i].size();j++) {
			cout << pe_sort[i][j].second << endl;
			cnt++;
			if (cnt == k) return 0;
		}
	}

    return 0;
}
0