結果

問題 No.406 鴨等間隔の法則
ユーザー nonokai10nonokai10
提出日時 2018-03-10 02:37:45
言語 Ruby
(3.3.0)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 126 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 11,256 KB
実行使用メモリ 26,828 KB
最終ジャッジ日時 2023-09-21 18:45:34
合計ジャッジ時間 5,335 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
19,452 KB
testcase_01 AC 82 ms
15,140 KB
testcase_02 AC 83 ms
15,148 KB
testcase_03 AC 78 ms
15,080 KB
testcase_04 AC 135 ms
25,288 KB
testcase_05 AC 102 ms
18,912 KB
testcase_06 AC 101 ms
19,312 KB
testcase_07 AC 103 ms
19,396 KB
testcase_08 AC 136 ms
25,192 KB
testcase_09 AC 149 ms
26,664 KB
testcase_10 AC 105 ms
19,608 KB
testcase_11 AC 127 ms
23,824 KB
testcase_12 AC 111 ms
20,676 KB
testcase_13 AC 108 ms
20,440 KB
testcase_14 AC 144 ms
24,320 KB
testcase_15 AC 84 ms
15,560 KB
testcase_16 AC 85 ms
15,644 KB
testcase_17 AC 84 ms
15,428 KB
testcase_18 AC 85 ms
15,800 KB
testcase_19 AC 85 ms
15,624 KB
testcase_20 AC 89 ms
15,980 KB
testcase_21 AC 89 ms
16,224 KB
testcase_22 AC 94 ms
17,416 KB
testcase_23 AC 114 ms
20,976 KB
testcase_24 AC 135 ms
23,428 KB
testcase_25 AC 148 ms
26,828 KB
testcase_26 AC 163 ms
26,732 KB
testcase_27 AC 131 ms
24,492 KB
testcase_28 AC 135 ms
26,828 KB
testcase_29 AC 163 ms
26,716 KB
testcase_30 AC 162 ms
26,552 KB
testcase_31 AC 147 ms
26,436 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a=gets.split.map(&:to_i).sort
puts a.uniq.size==n&&(0..n-2).inject([]){|d,i|d<<a[i+1]-a[i]}.uniq.size==1?:YES: :NO
0