結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー kurenai3110kurenai3110
提出日時 2016-10-15 09:08:25
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 113 ms / 4,000 ms
コード長 765 bytes
コンパイル時間 864 ms
コンパイル使用メモリ 71,348 KB
実行使用メモリ 7,532 KB
最終ジャッジ日時 2024-05-02 01:52:28
合計ジャッジ時間 5,229 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
7,532 KB
testcase_01 AC 81 ms
7,400 KB
testcase_02 AC 56 ms
7,396 KB
testcase_03 AC 84 ms
7,404 KB
testcase_04 AC 85 ms
7,404 KB
testcase_05 AC 68 ms
7,404 KB
testcase_06 AC 113 ms
7,400 KB
testcase_07 AC 59 ms
7,400 KB
testcase_08 AC 56 ms
7,528 KB
testcase_09 AC 71 ms
7,396 KB
testcase_10 AC 79 ms
7,272 KB
testcase_11 AC 94 ms
7,400 KB
testcase_12 AC 87 ms
7,396 KB
testcase_13 AC 53 ms
7,400 KB
testcase_14 AC 69 ms
7,400 KB
testcase_15 AC 44 ms
7,396 KB
testcase_16 AC 103 ms
7,400 KB
testcase_17 AC 100 ms
7,344 KB
testcase_18 AC 103 ms
7,268 KB
testcase_19 AC 53 ms
7,396 KB
testcase_20 AC 64 ms
7,396 KB
testcase_21 AC 59 ms
7,400 KB
testcase_22 AC 88 ms
7,400 KB
testcase_23 AC 71 ms
7,404 KB
testcase_24 AC 52 ms
7,528 KB
testcase_25 AC 81 ms
7,400 KB
testcase_26 AC 61 ms
7,404 KB
testcase_27 AC 82 ms
7,400 KB
testcase_28 AC 51 ms
7,400 KB
testcase_29 AC 89 ms
7,396 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 100 ms
7,360 KB
testcase_33 AC 106 ms
7,400 KB
testcase_34 AC 61 ms
7,396 KB
testcase_35 AC 1 ms
5,376 KB
testcase_36 AC 1 ms
5,376 KB
testcase_37 AC 1 ms
5,376 KB
testcase_38 AC 1 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 3 ms
5,376 KB
testcase_41 AC 7 ms
5,376 KB
testcase_42 AC 7 ms
5,376 KB
testcase_43 AC 7 ms
5,376 KB
testcase_44 AC 7 ms
5,376 KB
testcase_45 AC 3 ms
5,376 KB
testcase_46 AC 19 ms
5,376 KB
testcase_47 AC 19 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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

int Univ[100001];

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	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());

	for (int j = 0; j < data.size(); j++) {
		data[j].p += Univ[data[j].u] * (long long)1e7;
		Univ[data[j].u]++;
	}
	sort(data.begin(), data.end());

	for (int j = 0; j < k; j++) {
		cout << data[j].num << endl;
	}

	return 0;
}
0