結果

問題 No.1208 anti primenumber game
ユーザー tonyu0tonyu0
提出日時 2020-08-30 16:42:31
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 1,073 bytes
コンパイル時間 12,657 ms
コンパイル使用メモリ 401,524 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 10:15:00
合計ジャッジ時間 14,277 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

use std::io::*;
fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let m: i64 = itr.next().unwrap().parse().unwrap();
    let a: Vec<i64> = (0..n)
        .map(|_| itr.next().unwrap().parse().unwrap())
        .collect();

    let mut parity = 0; // その山を見たときどっちのターンか
    let mut score1 = 0i64;
    let mut score2 = 0i64;
    for &e in a.iter() {
        if parity & 1 == 0 {
            if e == 1 {
                score1 += 1 - m;
                parity ^= 1;
            } else {
                score1 += e - 1;
                score2 += 1 - m;
            }
        } else {
            if e == 1 {
                score2 += 1 - m;
                parity ^= 1;
            } else {
                score2 += e - 1;
                score1 += 1 - m;
            }
        }
    }
    if score1 > score2 {
        println!("First");
    } else {
        println!("Second");
    }
}
0