結果

問題 No.406 鴨等間隔の法則
ユーザー LEDLED
提出日時 2019-02-01 14:44:33
言語 Ruby
(3.3.0)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 127 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 11,316 KB
実行使用メモリ 25,532 KB
最終ジャッジ日時 2023-09-21 18:57:55
合計ジャッジ時間 5,943 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
19,168 KB
testcase_01 AC 81 ms
15,080 KB
testcase_02 AC 80 ms
15,132 KB
testcase_03 AC 81 ms
15,156 KB
testcase_04 AC 150 ms
24,120 KB
testcase_05 AC 109 ms
18,796 KB
testcase_06 AC 111 ms
19,048 KB
testcase_07 AC 112 ms
19,064 KB
testcase_08 AC 145 ms
23,912 KB
testcase_09 AC 158 ms
25,268 KB
testcase_10 AC 115 ms
19,212 KB
testcase_11 AC 138 ms
23,132 KB
testcase_12 AC 120 ms
19,888 KB
testcase_13 AC 117 ms
19,664 KB
testcase_14 AC 141 ms
23,240 KB
testcase_15 AC 85 ms
15,540 KB
testcase_16 AC 86 ms
15,724 KB
testcase_17 AC 84 ms
15,500 KB
testcase_18 AC 88 ms
15,836 KB
testcase_19 AC 89 ms
15,680 KB
testcase_20 AC 90 ms
16,144 KB
testcase_21 AC 91 ms
16,592 KB
testcase_22 AC 96 ms
17,148 KB
testcase_23 AC 123 ms
20,316 KB
testcase_24 AC 135 ms
22,504 KB
testcase_25 AC 163 ms
25,268 KB
testcase_26 AC 163 ms
25,176 KB
testcase_27 AC 150 ms
25,000 KB
testcase_28 AC 153 ms
25,532 KB
testcase_29 AC 161 ms
25,036 KB
testcase_30 AC 160 ms
24,992 KB
testcase_31 AC 160 ms
25,028 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n=gets.to_i
x=gets.split.map(&:to_i).sort
d=(1...x.size).to_a.map{|i|x[i]-x[i-1]}
puts d.uniq.size==1 && d[0]!=0 ? "YES" : "NO"
0