結果

問題 No.1047 Zero (Novice)
ユーザー phspls
提出日時 2022-11-29 00:21:03
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 13,868 ms
コンパイル使用メモリ 378,956 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 03:11:15
合計ジャッジ時間 13,426 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut ab = String::new();
    std::io::stdin().read_line(&mut ab).ok();
    let ab: Vec<isize> = ab.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let a = ab[0];
    let b = ab[1];

    if b == 0 {
        println!("1");
        return;
    } else if a == 0 {
        println!("-1");
        return;
    } else if a * b > 0 {
        println!("-1");
        return;
    }
    if a == -1 {
        println!("2");
    } else {
        println!("-1");
    }
}
0