結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー phsplsphspls
提出日時 2022-09-30 10:19:53
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 867 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 140,824 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-24 05:15:06
合計ジャッジ時間 2,296 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 1 ms
4,380 KB
testcase_18 WA -
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 WA -
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 1 ms
4,380 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 WA -
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 WA -
testcase_35 AC 1 ms
4,380 KB
testcase_36 AC 1 ms
4,380 KB
testcase_37 AC 1 ms
4,376 KB
testcase_38 AC 1 ms
4,376 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 1 ms
4,376 KB
testcase_41 AC 1 ms
4,376 KB
testcase_42 WA -
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 1 ms
4,376 KB
testcase_46 WA -
testcase_47 AC 1 ms
4,376 KB
testcase_48 AC 1 ms
4,380 KB
testcase_49 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    if y == 1 {
        println!("Yes");
        return;
    }
    let mut val = 0usize;
    let mut target = x.max(y);
    while target % x.min(y) == 0 {
        target /= x.min(y);
        val += 1;
    }
    if x >= y {
        if val == 0 {
            println!("No");
        } else if (val * a) % b == 0 {
            println!("Yes");
        } else {
            println!("No");
        }
    } else {
        if val == 0 {
            println!("No");
        } else if a % (val * b) == 0  {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}
0