結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 447 ms
14,368 KB
testcase_01 AC 415 ms
14,452 KB
testcase_02 AC 379 ms
14,316 KB
testcase_03 AC 455 ms
14,640 KB
testcase_04 AC 415 ms
14,628 KB
testcase_05 AC 401 ms
14,488 KB
testcase_06 AC 438 ms
14,468 KB
testcase_07 AC 386 ms
14,484 KB
testcase_08 AC 385 ms
14,676 KB
testcase_09 AC 403 ms
14,488 KB
testcase_10 AC 428 ms
14,312 KB
testcase_11 AC 459 ms
14,312 KB
testcase_12 AC 413 ms
14,472 KB
testcase_13 AC 374 ms
14,352 KB
testcase_14 AC 382 ms
14,316 KB
testcase_15 AC 359 ms
14,352 KB
testcase_16 AC 448 ms
14,248 KB
testcase_17 AC 442 ms
14,492 KB
testcase_18 AC 451 ms
14,316 KB
testcase_19 AC 377 ms
14,232 KB
testcase_20 AC 395 ms
14,456 KB
testcase_21 AC 375 ms
14,492 KB
testcase_22 AC 424 ms
14,312 KB
testcase_23 AC 392 ms
14,504 KB
testcase_24 AC 369 ms
14,632 KB
testcase_25 AC 416 ms
14,320 KB
testcase_26 AC 396 ms
14,428 KB
testcase_27 AC 410 ms
14,364 KB
testcase_28 AC 377 ms
14,376 KB
testcase_29 AC 405 ms
14,352 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 425 ms
14,780 KB
testcase_33 AC 442 ms
14,488 KB
testcase_34 AC 387 ms
14,304 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 2 ms
4,376 KB
testcase_39 AC 4 ms
4,380 KB
testcase_40 AC 4 ms
4,376 KB
testcase_41 AC 31 ms
4,376 KB
testcase_42 AC 29 ms
4,376 KB
testcase_43 AC 29 ms
4,428 KB
testcase_44 AC 29 ms
4,380 KB
testcase_45 AC 5 ms
4,376 KB
testcase_46 AC 43 ms
4,432 KB
testcase_47 AC 43 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: ラムダ関数内:
main.cpp:45:5: 警告: 制御が非 void 関数の終りに到達しました [-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