結果
| 問題 |
No.2922 Rose Garden
|
| コンテスト | |
| ユーザー |
naut3
|
| 提出日時 | 2024-10-12 17:36:38 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 3,000 ms |
| コード長 | 884 bytes |
| コンパイル時間 | 12,600 ms |
| コンパイル使用メモリ | 382,300 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-12 17:36:54 |
| 合計ジャッジ時間 | 15,110 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 |
ソースコード
#![allow(non_snake_case, unused_must_use, unused_imports)]
use std::io::{self, prelude::*};
fn main() {
let (stdin, stdout) = (io::read_to_string(io::stdin()).unwrap(), io::stdout());
let (mut stdin, mut buffer) = (stdin.split_whitespace(), io::BufWriter::new(stdout.lock()));
macro_rules! input {
($t: ty, $n: expr) => {
(0..$n).map(|_| input!($t)).collect::<Vec<_>>()
};
($t: ty) => {
stdin.next().unwrap().parse::<$t>().unwrap()
};
}
let N = input!(usize);
let S = input!(u64);
let B = input!(u64);
let H = input!(u64, N);
let mut max_height = H[0];
for i in 0..N {
max_height = std::cmp::max(max_height, H[i] + S * B);
if i + 1 < N && max_height < H[i + 1] {
writeln!(buffer, "No");
return;
}
}
writeln!(buffer, "Yes");
}
naut3