結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー ytftytft
提出日時 2021-03-22 10:38:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 501 ms / 4,000 ms
コード長 1,141 bytes
コンパイル時間 2,177 ms
コンパイル使用メモリ 187,660 KB
実行使用メモリ 14,804 KB
最終ジャッジ日時 2024-05-03 00:22:08
合計ジャッジ時間 20,632 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 479 ms
14,672 KB
testcase_01 AC 466 ms
14,480 KB
testcase_02 AC 428 ms
14,540 KB
testcase_03 AC 468 ms
14,548 KB
testcase_04 AC 466 ms
14,800 KB
testcase_05 AC 446 ms
14,540 KB
testcase_06 AC 488 ms
14,544 KB
testcase_07 AC 414 ms
14,544 KB
testcase_08 AC 414 ms
14,544 KB
testcase_09 AC 441 ms
14,668 KB
testcase_10 AC 417 ms
14,540 KB
testcase_11 AC 501 ms
14,540 KB
testcase_12 AC 440 ms
14,672 KB
testcase_13 AC 404 ms
14,544 KB
testcase_14 AC 412 ms
14,544 KB
testcase_15 AC 382 ms
14,544 KB
testcase_16 AC 466 ms
14,544 KB
testcase_17 AC 451 ms
14,676 KB
testcase_18 AC 474 ms
14,540 KB
testcase_19 AC 398 ms
14,540 KB
testcase_20 AC 414 ms
14,544 KB
testcase_21 AC 399 ms
14,544 KB
testcase_22 AC 452 ms
14,676 KB
testcase_23 AC 419 ms
14,548 KB
testcase_24 AC 407 ms
14,676 KB
testcase_25 AC 460 ms
14,672 KB
testcase_26 AC 438 ms
14,500 KB
testcase_27 AC 441 ms
14,804 KB
testcase_28 AC 398 ms
14,544 KB
testcase_29 AC 431 ms
14,668 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 451 ms
14,672 KB
testcase_33 AC 469 ms
14,544 KB
testcase_34 AC 411 ms
14,540 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 3 ms
5,376 KB
testcase_39 AC 4 ms
5,376 KB
testcase_40 AC 5 ms
5,376 KB
testcase_41 AC 32 ms
5,376 KB
testcase_42 AC 30 ms
5,376 KB
testcase_43 AC 29 ms
5,376 KB
testcase_44 AC 30 ms
5,376 KB
testcase_45 AC 6 ms
5,376 KB
testcase_46 AC 43 ms
5,376 KB
testcase_47 AC 44 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In lambda function:
main.cpp:45:5: warning: control reaches end of non-void function [-Wreturn-type]
   45 |     };
      |     ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;


int main(){
    vector<vector<int>> parent(11);
    int N,K;
    cin>>N>>K;
    int S,P,U;
    vector<vector<long long>> teams(0);
    for(int i=0;i<N;i++){
        cin>>S>>P>>U;
        teams.push_back({S,P,U,i});
    }
    function<bool(vector<long long>,vector<long long>)> fn=[](vector<long long> v,vector<long long> t){
        if(v[2]!=t[2]){
            return v[2]<t[2];
        }
        if(v[0]!=t[0]){
            return v[0]>t[0];
        }
        return v[1]<t[1];
    };
    sort(teams.begin(),teams.end(),fn);
    teams[0].push_back(0);
    int cur=0;
    for(int i=1;i<N;i++){
        if(teams[i][2]!=teams[i-1][2]){
            cur=0;
        }else{
            cur++;
        }
        teams[i].push_back(cur);
    }
    fn=[](vector<long long> v,vector<long long> t){
        if(v[0]!=t[0]){
            return v[0]>t[0];
        }
        if(v[4]!=t[4]){
            return v[4]<t[4];
        }
        if(v[1]!=t[1]){
            return v[1]<t[1];
        }
    };
    sort(teams.begin(),teams.end(),fn);
    for(int i=0;i<K;i++){
        cout<<teams[i][3]<<endl;
    }
}
0