結果

問題 No.3112 Decrement or Mod Game
コンテスト
ユーザー zer0-star
提出日時 2025-04-19 01:00:51
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 903 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,508 ms
コンパイル使用メモリ 182,140 KB
実行使用メモリ 9,924 KB
最終ジャッジ日時 2026-10-17 00:17:15
合計ジャッジ時間 4,593 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 66 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: constant `DIRS` is never used
 --> src/main.rs:3:7
  |
3 | const DIRS: [(isize, isize); 4] = [(0, 1), (1, 0), (0, -1), (-1, 0)];
  |       ^^^^
  |
  = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

warning: trait `OrdExt` is never used
 --> src/main.rs:5:7
  |
5 | trait OrdExt {
  |       ^^^^^^

warning: variable `A` should have a snake case name
  --> src/main.rs:33:9
   |
33 |         A: usize,
   |         ^ help: convert the identifier to snake case: `a`
   |
   = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default

warning: variable `B` should have a snake case name
  --> src/main.rs:34:9
   |
34 |         B: usize,
   |         ^ help: convert the identifier to snake case: `b`

ソースコード

diff #
raw source code

use proconio::{fastout, input};

const DIRS: [(isize, isize); 4] = [(0, 1), (1, 0), (0, -1), (-1, 0)];

trait OrdExt {
    fn chmax(&mut self, other: Self) -> bool;
    fn chmin(&mut self, other: Self) -> bool;
}

impl<T: Ord> OrdExt for T {
    fn chmax(&mut self, other: Self) -> bool {
        if *self < other {
            *self = other;
            true
        } else {
            false
        }
    }

    fn chmin(&mut self, other: Self) -> bool {
        if *self > other {
            *self = other;
            true
        } else {
            false
        }
    }
}

#[fastout]
fn main() {
    input! {
        A: usize,
        B: usize,
    }

    if A == 1 {
        println!("Alice");
    } else if A == B {
        println!("Alice");
    } else if A == B + 1 {
        println!("Bob");
    } else if A > B {
        println!("Alice");
    } else {
        println!("Bob");
    }
}
0