結果
| 問題 |
No.3120 Lower Nim
|
| コンテスト | |
| ユーザー |
lumc_
|
| 提出日時 | 2025-04-20 11:42:47 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,817 bytes |
| コンパイル時間 | 13,752 ms |
| コンパイル使用メモリ | 389,404 KB |
| 実行使用メモリ | 26,356 KB |
| 平均クエリ数 | 1407.41 |
| 最終ジャッジ日時 | 2025-04-20 11:43:22 |
| 合計ジャッジ時間 | 20,381 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 18 RE * 25 |
ソースコード
#![allow(
dead_code,
non_snake_case,
unused_imports,
unused_mut,
unused_variables,
while_true,
unused_assignments,
clippy::needless_range_loop,
clippy::ptr_arg,
clippy::type_complexity,
clippy::unnecessary_cast
)]
use proconio::{
input,
marker::{Chars, Usize1 as usize1},
source::line::LineSource,
};
use std::collections::{BinaryHeap, HashMap, HashSet, VecDeque};
type Memo = HashMap<usize, HashMap<Option<usize>, i64>>;
use std::collections::BTreeSet;
use std::io::{BufReader, Write, stdin, stdout};
fn main() {
let stdin = stdin();
let mut source = LineSource::new(BufReader::new(stdin.lock()));
input! {
from &mut source,
N: usize,
mut A: [u64; N],
};
let mut c = 0;
let mut K = 2;
macro_rules! read {
() => {
input! {
from &mut source,
i: usize1, x: u64,
stat: usize,
};
if K != x {
K = x;
c = 0;
}
A[i] -= x;
if stat != 0 {
return;
}
};
}
let ASum = A.iter().sum::<u64>();
if ASum % 2 == 0 {
println!("Second");
stdout().flush().unwrap();
read!();
} else {
println!("First");
K = 1;
}
loop {
if K > 2 {
if K % 2 == 1 {
K = 1;
} else {
K = 2;
}
}
while A[c] < K {
c += 1;
}
println!("{} {}", c + 1, K);
A[c] -= K;
stdout().flush().unwrap();
input! {
from &mut source,
stat: usize,
}
if stat != 0 {
return;
}
read!();
}
}
lumc_