結果

問題 No.1208 anti primenumber game
ユーザー Falcon_
提出日時 2020-08-30 15:38:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 1,823 ms
コンパイル使用メモリ 171,828 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2024-11-15 09:52:47
合計ジャッジ時間 7,536 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 RE * 1
other WA * 32 RE * 12
権限があれば一括ダウンロードができます

ソースコード

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