結果

問題 No.2 素因数ゲーム
ユーザー ixTL255ixTL255
提出日時 2023-03-05 18:41:19
言語 Rust
(1.77.0)
結果
AC  
実行時間 375 ms / 5,000 ms
コード長 394 bytes
コンパイル時間 739 ms
コンパイル使用メモリ 166,884 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 04:59:15
合計ジャッジ時間 8,227 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 0 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 47 ms
4,348 KB
testcase_07 AC 54 ms
4,348 KB
testcase_08 AC 49 ms
4,348 KB
testcase_09 AC 375 ms
4,348 KB
testcase_10 AC 321 ms
4,348 KB
testcase_11 AC 152 ms
4,348 KB
testcase_12 AC 150 ms
4,348 KB
testcase_13 AC 305 ms
4,348 KB
testcase_14 AC 28 ms
4,348 KB
testcase_15 AC 89 ms
4,348 KB
testcase_16 AC 219 ms
4,348 KB
testcase_17 AC 327 ms
4,348 KB
testcase_18 AC 351 ms
4,348 KB
testcase_19 AC 202 ms
4,348 KB
testcase_20 AC 270 ms
4,348 KB
testcase_21 AC 366 ms
4,348 KB
testcase_22 AC 337 ms
4,348 KB
testcase_23 AC 157 ms
4,348 KB
testcase_24 AC 352 ms
4,348 KB
testcase_25 AC 262 ms
4,348 KB
testcase_26 AC 184 ms
4,348 KB
testcase_27 AC 97 ms
4,348 KB
testcase_28 AC 210 ms
4,348 KB
testcase_29 AC 172 ms
4,348 KB
testcase_30 AC 159 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unnecessary parentheses around `while` condition
 --> Main.rs:9:14
  |
9 |         while(n % i == 0) {
  |              ^          ^
  |
  = note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
  |
9 -         while(n % i == 0) {
9 +         while n % i == 0 {
  |

warning: 1 warning emitted

ソースコード

diff #

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let mut n: usize = n.trim().parse().unwrap();

    let mut ans = 0;
    for i in 2..=n {
        let mut cnt = 0;
        while(n % i == 0) {
            cnt += 1;
            n /= i;
        }
        ans ^= cnt;
    }
    println!("{}",
        if ans == 0 { "Bob" }
        else { "Alice" }
    );
}
0