結果

問題 No.1208 anti primenumber game
ユーザー cpcznksutbeoacpcznksutbeoa
提出日時 2020-08-30 15:38:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 1,765 ms
コンパイル使用メモリ 171,928 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 09:03:03
合計ジャッジ時間 7,327 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 RE -
testcase_20 RE -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 RE -
testcase_25 RE -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 RE -
testcase_30 WA -
testcase_31 RE -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 RE -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 RE -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    long long N,M;cin>>N>>M;vector<long long>A(N);for(int i=0;i<N;i++)cin>>A[i];
    sort(A.begin(),A.end());reverse(A.begin(),A.end());
    long long count=0,ans=0;
    for(int i=0;i<M;i++){
        if(i%2==0)count+=A[i]-M;
        else ans+=A[i]-M;
    }
    cout<<(count>ans? "first":"second")<<endl;
}
0