結果

問題 No.1208 anti primenumber game
ユーザー t98slidert98slider
提出日時 2023-07-24 02:50:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 702 bytes
コンパイル時間 2,289 ms
コンパイル使用メモリ 173,760 KB
実行使用メモリ 4,792 KB
最終ジャッジ日時 2023-10-25 10:34:11
合計ジャッジ時間 5,007 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 3 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 3 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 16 ms
4,792 KB
testcase_16 AC 16 ms
4,792 KB
testcase_17 AC 16 ms
4,792 KB
testcase_18 AC 16 ms
4,792 KB
testcase_19 AC 16 ms
4,792 KB
testcase_20 AC 16 ms
4,792 KB
testcase_21 WA -
testcase_22 AC 20 ms
4,792 KB
testcase_23 AC 17 ms
4,792 KB
testcase_24 WA -
testcase_25 AC 33 ms
4,792 KB
testcase_26 AC 44 ms
4,792 KB
testcase_27 AC 44 ms
4,792 KB
testcase_28 AC 45 ms
4,792 KB
testcase_29 AC 44 ms
4,792 KB
testcase_30 WA -
testcase_31 AC 17 ms
4,792 KB
testcase_32 AC 17 ms
4,792 KB
testcase_33 AC 18 ms
4,792 KB
testcase_34 WA -
testcase_35 AC 16 ms
4,792 KB
testcase_36 AC 13 ms
4,528 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 38 ms
4,792 KB
testcase_40 AC 43 ms
4,792 KB
testcase_41 AC 20 ms
4,792 KB
testcase_42 AC 21 ms
4,792 KB
testcase_43 WA -
testcase_44 AC 21 ms
4,792 KB
testcase_45 WA -
testcase_46 AC 17 ms
4,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    ll m, v = 0;
    cin >> n >> m;
    vector<ll> a(n);
    for(auto &&v : a) cin >> v;
    sort(a.rbegin(), a.rend());
    if(m >= 1){
        int turn = 0;
        for(int i = 0; i < n; i++){
            if(a[i] == 1) break;
            v += turn ? -a[i] : a[i];
            turn ^= 1;
        }
        for(int i = 0; i < n; i++){
            v += turn ? m - 1 : -m + 1;
            turn ^= 1;
        }
    }else{
        for(int i = 0; i < n; i++){
            v += i & 1 ? -a[i] : a[i];
        }
    }
    cout << (v > 0 ? "First" : "Second") << '\n';
}
0