結果

問題 No.1208 anti primenumber game
ユーザー 夜
提出日時 2020-10-01 03:47:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,063 bytes
コンパイル時間 1,579 ms
コンパイル使用メモリ 91,004 KB
実行使用メモリ 5,132 KB
最終ジャッジ日時 2023-09-21 01:05:30
合計ジャッジ時間 4,924 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 30 ms
4,940 KB
testcase_16 AC 30 ms
4,844 KB
testcase_17 AC 31 ms
4,840 KB
testcase_18 AC 30 ms
4,960 KB
testcase_19 AC 30 ms
4,920 KB
testcase_20 AC 30 ms
4,920 KB
testcase_21 AC 30 ms
5,024 KB
testcase_22 AC 31 ms
4,916 KB
testcase_23 AC 31 ms
4,844 KB
testcase_24 AC 99 ms
5,020 KB
testcase_25 AC 100 ms
4,980 KB
testcase_26 AC 93 ms
4,852 KB
testcase_27 AC 93 ms
5,132 KB
testcase_28 AC 93 ms
4,972 KB
testcase_29 AC 93 ms
4,916 KB
testcase_30 WA -
testcase_31 AC 30 ms
4,848 KB
testcase_32 AC 30 ms
4,844 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 24 ms
4,580 KB
testcase_37 AC 30 ms
5,032 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 91 ms
5,096 KB
testcase_41 AC 36 ms
5,028 KB
testcase_42 AC 36 ms
4,952 KB
testcase_43 WA -
testcase_44 AC 36 ms
5,092 KB
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long a[200020];
int main() {
    long long n, m;
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    long long f = 0, s = 0;
    bool b = true;
    for (int i = 0; i < n; i++) {
        if (b) {
            if (a[i] == 1) {
                b = false;
                f -= m - 1;
            }
            else {
                f += a[i] - 1;
                s -= m - 1;
            }
        }
        else {
            if (a[i] == 1) {
                b = true;
                s -= m - 1;
            }
            else {
                s += a[i] - 1;
                f -= m - 1;
            }
        }
    }
    if (f > s) {
        cout << "First" << endl;
    }
    else {
        cout << "Second" << endl;
    }
    return 0;
}
0