結果
問題 | No.570 3人兄弟(その1) |
ユーザー |
![]() |
提出日時 | 2017-10-06 23:56:43 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 784 bytes |
コンパイル時間 | 11,974 ms |
コンパイル使用メモリ | 378,188 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 02:17:53 |
合計ジャッジ時間 | 12,624 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 |
ソースコード
use std::io::*;use std::str::*;fn readw<T: FromStr, R: Read>(s: &mut R) -> Option<T> {let s = s.bytes().map(|c| c.unwrap() as char).skip_while(|c| c.is_whitespace()).take_while(|c| !c.is_whitespace()).collect::<String>();if s.is_empty() {None} else {s.parse::<T>().ok()}}fn read<T: FromStr, R: Read>(s: &mut R) -> T {readw(s).unwrap_or_else(|| std::process::exit(0))}fn main() {let s = stdin();let s = s.lock();let s = &mut BufReader::new(s);loop {let (a, b, c): (u32, u32, u32) = (read(s), read(s), read(s));let mut v = [(a, 'A'), (b, 'B'), (c, 'C')];v.sort();v.reverse();for &x in &v {println!("{}", x.1);}}}