結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2016-07-12 21:20:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,553 bytes
コンパイル時間 1,781 ms
コンパイル使用メモリ 173,140 KB
実行使用メモリ 10,568 KB
最終ジャッジ日時 2024-04-22 17:39:42
合計ジャッジ時間 52,334 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 1,327 ms
8,552 KB
testcase_11 AC 1,294 ms
8,548 KB
testcase_12 AC 1,392 ms
8,336 KB
testcase_13 AC 1,296 ms
8,552 KB
testcase_14 AC 1,325 ms
8,548 KB
testcase_15 AC 1,270 ms
8,416 KB
testcase_16 AC 1,340 ms
8,552 KB
testcase_17 AC 1,330 ms
8,544 KB
testcase_18 AC 1,301 ms
8,552 KB
testcase_19 AC 1,316 ms
8,552 KB
testcase_20 AC 1,341 ms
8,552 KB
testcase_21 AC 1,288 ms
8,548 KB
testcase_22 AC 1,337 ms
8,552 KB
testcase_23 AC 1,291 ms
8,420 KB
testcase_24 AC 1,286 ms
8,548 KB
testcase_25 AC 1,307 ms
8,548 KB
testcase_26 AC 1,303 ms
8,420 KB
testcase_27 AC 1,324 ms
8,548 KB
testcase_28 AC 1,276 ms
8,676 KB
testcase_29 AC 1,343 ms
8,676 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 3 ms
5,376 KB
testcase_37 AC 3 ms
5,376 KB
testcase_38 AC 4 ms
5,376 KB
testcase_39 AC 16 ms
5,376 KB
testcase_40 AC 25 ms
5,376 KB
testcase_41 AC 135 ms
5,376 KB
testcase_42 AC 134 ms
5,376 KB
testcase_43 AC 134 ms
5,376 KB
testcase_44 AC 131 ms
5,376 KB
testcase_45 AC 16 ms
5,376 KB
testcase_46 AC 139 ms
5,376 KB
testcase_47 AC 145 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
typedef vector<vector<int>> Graph;
const int inf = 1e9;
const int mod = 1e9 + 7;

struct Data {
    int id_team, id_univ;
    int ac, ue, pena;
    Data(){}
    Data(int _id_team, int _id_univ, int _ac, int _ue, int _pena)
        : id_team(_id_team), id_univ(_id_univ), ac(_ac), ue(_ue), pena(_pena) {}
    bool operator<(const Data& r) const {
        return ac == r.ac ? (ue == r.ue ? pena < r.pena : ue < r.ue) : ac > r.ac;
    }
    void print() {
        cerr << id_team << " " << id_univ << " " << ac << " " << ue << " " << pena << endl;
    }
};

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

    int N, K;
    cin >> N >> K;
    vector<Data> teams;
    rep(i, N) {
        int s, p, u;
        cin >> s >> p >> u;
        teams.emplace_back(i, u, s, 0, p);
    }
    sort(all(teams));
    rep(i, N) teams[i].print();

    int cnt_ue[101] = {};
    rep(i, N) {
        teams[i].ue = cnt_ue[teams[i].id_univ];
        ++cnt_ue[teams[i].id_univ];
    }
    sort(all(teams));

    rep(i, K) {
        cout << teams[i].id_team << endl;
    }
}
0