結果

問題 No.406 鴨等間隔の法則
ユーザー kazukikazuki
提出日時 2018-12-07 22:13:58
言語 Ruby
(3.3.0)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 185 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 11,504 KB
実行使用メモリ 22,912 KB
最終ジャッジ日時 2023-09-21 18:56:56
合計ジャッジ時間 5,569 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
17,968 KB
testcase_01 AC 77 ms
15,244 KB
testcase_02 AC 77 ms
15,272 KB
testcase_03 AC 78 ms
15,124 KB
testcase_04 AC 126 ms
21,804 KB
testcase_05 AC 96 ms
17,360 KB
testcase_06 AC 97 ms
17,552 KB
testcase_07 AC 97 ms
17,840 KB
testcase_08 AC 124 ms
21,548 KB
testcase_09 AC 135 ms
22,712 KB
testcase_10 AC 100 ms
18,064 KB
testcase_11 AC 118 ms
20,688 KB
testcase_12 AC 107 ms
19,056 KB
testcase_13 AC 104 ms
18,660 KB
testcase_14 AC 135 ms
21,368 KB
testcase_15 AC 81 ms
15,568 KB
testcase_16 AC 81 ms
15,568 KB
testcase_17 AC 81 ms
15,144 KB
testcase_18 AC 83 ms
15,384 KB
testcase_19 AC 83 ms
15,532 KB
testcase_20 AC 86 ms
15,688 KB
testcase_21 AC 84 ms
15,740 KB
testcase_22 AC 92 ms
16,508 KB
testcase_23 AC 107 ms
19,000 KB
testcase_24 AC 127 ms
20,368 KB
testcase_25 AC 136 ms
22,640 KB
testcase_26 AC 153 ms
22,844 KB
testcase_27 AC 124 ms
22,560 KB
testcase_28 AC 125 ms
22,608 KB
testcase_29 AC 151 ms
22,912 KB
testcase_30 AC 152 ms
22,752 KB
testcase_31 AC 136 ms
22,220 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] || x[i+1] == x[i] || x[i+2] == x[i+1]
    puts 'NO'
    exit
  end
end

puts 'YES'
0