結果

問題 No.1208 anti primenumber game
ユーザー t98slidert98slider
提出日時 2023-07-24 02:47:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 694 bytes
コンパイル時間 1,422 ms
コンパイル使用メモリ 174,048 KB
実行使用メモリ 4,824 KB
最終ジャッジ日時 2023-10-25 10:30:44
合計ジャッジ時間 5,560 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 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 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 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 1 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 15 ms
4,824 KB
testcase_16 AC 14 ms
4,824 KB
testcase_17 AC 15 ms
4,824 KB
testcase_18 AC 14 ms
4,824 KB
testcase_19 AC 14 ms
4,824 KB
testcase_20 AC 14 ms
4,824 KB
testcase_21 WA -
testcase_22 AC 18 ms
4,824 KB
testcase_23 AC 16 ms
4,824 KB
testcase_24 WA -
testcase_25 AC 30 ms
4,824 KB
testcase_26 AC 39 ms
4,824 KB
testcase_27 AC 39 ms
4,824 KB
testcase_28 AC 40 ms
4,824 KB
testcase_29 AC 40 ms
4,824 KB
testcase_30 WA -
testcase_31 AC 15 ms
4,824 KB
testcase_32 AC 15 ms
4,824 KB
testcase_33 AC 15 ms
4,824 KB
testcase_34 WA -
testcase_35 AC 15 ms
4,824 KB
testcase_36 AC 13 ms
4,560 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 33 ms
4,824 KB
testcase_40 AC 38 ms
4,824 KB
testcase_41 AC 17 ms
4,824 KB
testcase_42 AC 19 ms
4,824 KB
testcase_43 WA -
testcase_44 AC 18 ms
4,824 KB
testcase_45 WA -
testcase_46 AC 15 ms
4,560 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 : -m;
            turn ^= 1;
        }
    }else{
        for(int i = 0; i < n; i++){
            v += i & 1 ? -a[i] : a[i];
        }
    }
    cout << (v > 0 ? "First" : "Second") << '\n';
}
0