結果
問題 |
No.512 魔法少女の追いかけっこ
|
ユーザー |
![]() |
提出日時 | 2020-02-04 23:20:02 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 379 bytes |
コンパイル時間 | 146 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-09-21 07:50:38 |
合計ジャッジ時間 | 6,301 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 52 WA * 1 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n Syntax OK
ソースコード
x, y = gets.chomp.split.map(&:to_f) n = gets.chomp.to_i a = gets.chomp.split.map(&:to_f) a.each_cons(2) do |ai, aj| # aj m地点まで来るのに師匠がどれくらい時間がかかるのか求める(= t時間) # t = aj / 1000 / y # t時間でkobaが何m進むのか求める(= d m) # d = t * x * 1000 if aj / y * x < ai puts 'NO' exit end end puts 'YES'