結果
| 問題 | No.920 あかあお |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-31 16:38:47 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 2,000 ms |
| + 923µs | |
| コード長 | 545 bytes |
| 記録 | |
| コンパイル時間 | 387 ms |
| コンパイル使用メモリ | 179,160 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-21 00:10:45 |
| 合計ジャッジ時間 | 1,918 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
fn main() {
let stdin = std::io::read_to_string(std::io::stdin()).unwrap();
let mut stdin = stdin.split_ascii_whitespace();
let x: u8 = stdin.next().unwrap().parse().unwrap();
let y: u8 = stdin.next().unwrap().parse().unwrap();
let z: u8 = stdin.next().unwrap().parse().unwrap();
println!("{}", output(solve(x, y, z)));
}
fn solve(x: u8, y: u8, z: u8) -> u8 {
if x + z <= y {
x + z
} else if y + z <= x {
y + z
} else {
(x + y + z) / 2
}
}
fn output(ans: u8) -> u8 {
ans
}