結果
問題 |
No.512 魔法少女の追いかけっこ
|
ユーザー |
|
提出日時 | 2017-06-20 10:59:04 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 592 bytes |
コンパイル時間 | 630 ms |
コンパイル使用メモリ | 102,536 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 20:17:19 |
合計ジャッジ時間 | 1,930 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 53 |
ソースコード
import std.stdio, std.string, std.conv, std.algorithm; import std.range, std.array, std.math, std.typecons; immutable int inf = 10^^9 + 7; int x, y; int n; int[] a; void main() { scan(x, y); scan(n); a = readln.split.to!(int[]); foreach (i ; 0 .. n - 1) { if (a[i] * y > x * a[i + 1]) { writeln("NO"); return; } } "YES".writeln; } void scan(T...)(ref T args) { auto line = readln.split; foreach (ref arg ; args) { arg = line.front.to!(typeof(arg)); line.popFront(); } assert(line.empty); }