結果
問題 | No.571 3人兄弟(その2) |
ユーザー |
![]() |
提出日時 | 2017-10-07 00:01:40 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 873 bytes |
コンパイル時間 | 12,158 ms |
コンパイル使用メモリ | 378,684 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 03:05:31 |
合計ジャッジ時間 | 13,070 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
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: (i32, i32, _) = (-read::<i32, _>(s), read(s), 'A');let b: (i32, i32, _) = (-read::<i32, _>(s), read(s), 'B');let c: (i32, i32, _) = (-read::<i32, _>(s), read(s), 'C');let mut v = [a, b, c];v.sort();for &x in &v {println!("{}", x.2);}}}