結果
| 問題 | No.892 タピオカ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-31 16:54:39 |
| 言語 | Rust (1.92.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 837 bytes |
| 記録 | |
| コンパイル時間 | 797 ms |
| コンパイル使用メモリ | 197,640 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-31 16:54:41 |
| 合計ジャッジ時間 | 1,976 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
fn main() {
let stdin = std::io::read_to_string(std::io::stdin()).unwrap();
let mut stdin = stdin.split_ascii_whitespace();
let balls: [(u32, u32); 3] = [
(
stdin.next().unwrap().parse().unwrap(),
stdin.next().unwrap().parse().unwrap(),
),
(
stdin.next().unwrap().parse().unwrap(),
stdin.next().unwrap().parse().unwrap(),
),
(
stdin.next().unwrap().parse().unwrap(),
stdin.next().unwrap().parse().unwrap(),
),
];
println!("{}", output(solve(balls)));
}
fn solve(balls: [(u32, u32); 3]) -> bool {
balls
.into_iter()
.fold(true, |acc, (a, _)| acc ^ (a & 1 == 1))
}
fn output(ans: bool) -> &'static str {
match ans {
true => ":-)",
false => ":-(",
}
}