結果
| 問題 | No.1579 New Type of Nim |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-25 01:01:01 |
| 言語 | Rust (1.92.0 + proconio + num) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 440 bytes |
| 記録 | |
| コンパイル時間 | 13,142 ms |
| コンパイル使用メモリ | 386,308 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-01 13:03:51 |
| 合計ジャッジ時間 | 13,979 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
fn main() {
let mut ab = String::new();
std::io::stdin().read_line(&mut ab).ok();
let ab: Vec<usize> = ab.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
let a = ab[0];
let b = ab[1];
let (a, b) = (a.max(b), a.min(b));
if a == b || a - b == 1 {
if b % 2 == 1 {
println!("Q");
} else {
println!("P");
}
} else {
println!("P");
}
}