結果
問題 | No.512 魔法少女の追いかけっこ |
ユーザー |
|
提出日時 | 2022-11-24 18:21:27 |
言語 | JavaScript (node v23.5.0) |
結果 |
AC
|
実行時間 | 67 ms / 2,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 34 ms |
コンパイル使用メモリ | 6,816 KB |
実行使用メモリ | 39,040 KB |
最終ジャッジ日時 | 2024-10-01 08:02:59 |
合計ジャッジ時間 | 4,973 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 53 |
ソースコード
function sub(n, x, y, a) {for (let i = 0; i < n - 1; i++) {const p1 = parseInt(a[i]);const p2 = parseInt(a[i + 1]);if (y * p1 > p2 * x) {return "NO";}}return "YES";}function Main(input) {const src = input.split("\n");const tmp = src[0].split(" ");const x = parseInt(tmp[0]);const y = parseInt(tmp[1]);const n = parseInt(src[1]);const a = src[2].split(" ");console.log(sub(n, x, y, a));}Main(require("fs").readFileSync("/dev/stdin", "utf8"));