結果

問題 No.3032 Unavailability of Inequality Signs
ユーザー lzy9lzy9
提出日時 2018-04-01 22:43:01
言語 Rust
(1.77.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 934 bytes
コンパイル時間 1,046 ms
コンパイル使用メモリ 147,776 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-08 12:48:07
合計ジャッジ時間 1,995 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `std::str::FromStr`
 --> Main.rs:2:5
  |
2 | use std::str::FromStr;
  |     ^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused imports: `max`, `min`
 --> Main.rs:3:16
  |
3 | use std::cmp::{min, max};
  |                ^^^  ^^^

warning: 2 warnings emitted

ソースコード

diff #

use std::io::*;
use std::str::FromStr;
use std::cmp::{min, max};

fn main() {
    let mut str = String::new();
    stdin().read_line(&mut str).unwrap();

    let n: i32 = str.trim().parse().ok().unwrap();

    for _ in 0..n {
        str = stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();

        let a: i32 = str.parse().ok().unwrap();

        str = stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();

        let b: i32 = str.parse().ok().unwrap();

        if a.lt(&b) {
            println!("{}", 60 as char)
        } else if a.eq(&b) {
            println!("{}", 61 as char)
        } else {
            println!("{}", 62 as char)
        }
    }
}
0