結果

問題 No.512 魔法少女の追いかけっこ
ユーザー phspls
提出日時 2020-02-22 12:04:55
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 654 bytes
コンパイル時間 23,036 ms
コンパイル使用メモリ 404,996 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-09 15:56:30
合計ジャッジ時間 14,547 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 53
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    for i in 0..n-1 {
        if x * a[i+1] < y * a[i] {
            println!("NO");
            return;
        }
    }
    println!("YES");
}
0