結果

問題 No.406 鴨等間隔の法則
ユーザー kazukikazuki
提出日時 2018-12-05 23:57:08
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 147 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 11,500 KB
実行使用メモリ 22,920 KB
最終ジャッジ日時 2023-09-29 16:00:14
合計ジャッジ時間 5,670 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
17,812 KB
testcase_01 AC 77 ms
15,268 KB
testcase_02 AC 77 ms
15,128 KB
testcase_03 WA -
testcase_04 AC 127 ms
21,576 KB
testcase_05 AC 97 ms
17,404 KB
testcase_06 AC 97 ms
17,728 KB
testcase_07 AC 98 ms
17,688 KB
testcase_08 AC 123 ms
21,744 KB
testcase_09 AC 136 ms
22,736 KB
testcase_10 AC 99 ms
18,028 KB
testcase_11 AC 119 ms
20,620 KB
testcase_12 AC 106 ms
18,912 KB
testcase_13 AC 104 ms
18,608 KB
testcase_14 AC 134 ms
21,380 KB
testcase_15 WA -
testcase_16 AC 85 ms
15,396 KB
testcase_17 AC 83 ms
15,324 KB
testcase_18 AC 85 ms
15,308 KB
testcase_19 AC 85 ms
15,344 KB
testcase_20 AC 88 ms
15,544 KB
testcase_21 AC 83 ms
15,656 KB
testcase_22 AC 90 ms
16,652 KB
testcase_23 AC 106 ms
19,084 KB
testcase_24 AC 125 ms
20,560 KB
testcase_25 AC 136 ms
22,844 KB
testcase_26 AC 147 ms
22,920 KB
testcase_27 WA -
testcase_28 AC 128 ms
22,676 KB
testcase_29 AC 146 ms
22,844 KB
testcase_30 AC 146 ms
22,560 KB
testcase_31 AC 134 ms
22,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i

x = gets.split.map(&:to_i).sort!

(n-2).times do |i|
  if x[i+1]-x[i] != x[i+2]-x[i+1]
    puts 'NO'
    exit
  end
end

puts 'YES'
0