結果

問題 No.406 鴨等間隔の法則
ユーザー shi-moshi-mo
提出日時 2016-08-31 21:49:59
言語 Ruby
(3.3.0)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 11,556 KB
実行使用メモリ 23,664 KB
最終ジャッジ日時 2023-09-21 18:05:39
合計ジャッジ時間 5,353 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
18,224 KB
testcase_01 AC 81 ms
15,080 KB
testcase_02 AC 82 ms
15,152 KB
testcase_03 AC 82 ms
15,128 KB
testcase_04 AC 131 ms
22,672 KB
testcase_05 AC 102 ms
17,832 KB
testcase_06 AC 103 ms
17,916 KB
testcase_07 AC 104 ms
18,116 KB
testcase_08 AC 130 ms
22,560 KB
testcase_09 AC 143 ms
23,548 KB
testcase_10 AC 105 ms
18,232 KB
testcase_11 AC 124 ms
21,380 KB
testcase_12 AC 111 ms
19,208 KB
testcase_13 AC 108 ms
18,872 KB
testcase_14 AC 132 ms
21,776 KB
testcase_15 AC 85 ms
15,552 KB
testcase_16 AC 85 ms
15,304 KB
testcase_17 AC 85 ms
15,388 KB
testcase_18 AC 85 ms
15,600 KB
testcase_19 AC 86 ms
15,596 KB
testcase_20 AC 89 ms
15,860 KB
testcase_21 AC 88 ms
15,748 KB
testcase_22 AC 95 ms
16,688 KB
testcase_23 AC 112 ms
19,584 KB
testcase_24 AC 129 ms
21,136 KB
testcase_25 AC 145 ms
23,424 KB
testcase_26 AC 155 ms
23,664 KB
testcase_27 AC 131 ms
23,356 KB
testcase_28 AC 133 ms
23,500 KB
testcase_29 AC 151 ms
23,512 KB
testcase_30 AC 152 ms
23,384 KB
testcase_31 AC 143 ms
22,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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

d = x[1] - x[0]
if 0 == d
  puts 'NO'
  exit 0
end

2.upto(n-1) do |i|
  if (x[i] - x[i-1]) != d
    puts 'NO'
    exit 0
  end
end
puts 'YES'
0