結果

問題 No.406 鴨等間隔の法則
ユーザー hogeover30hogeover30
提出日時 2016-09-18 19:14:11
言語 Ruby
(3.3.0)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 141 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 11,356 KB
実行使用メモリ 26,868 KB
最終ジャッジ日時 2023-09-21 18:13:24
合計ジャッジ時間 5,959 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
19,640 KB
testcase_01 AC 78 ms
15,196 KB
testcase_02 AC 76 ms
15,056 KB
testcase_03 AC 77 ms
15,240 KB
testcase_04 AC 151 ms
25,308 KB
testcase_05 AC 106 ms
18,908 KB
testcase_06 AC 107 ms
19,368 KB
testcase_07 AC 107 ms
19,392 KB
testcase_08 AC 150 ms
25,204 KB
testcase_09 AC 160 ms
26,664 KB
testcase_10 AC 109 ms
19,584 KB
testcase_11 AC 139 ms
23,924 KB
testcase_12 AC 117 ms
21,052 KB
testcase_13 AC 114 ms
20,200 KB
testcase_14 AC 134 ms
24,404 KB
testcase_15 AC 80 ms
15,320 KB
testcase_16 AC 82 ms
15,752 KB
testcase_17 AC 80 ms
15,348 KB
testcase_18 AC 82 ms
15,740 KB
testcase_19 AC 83 ms
15,788 KB
testcase_20 AC 86 ms
16,252 KB
testcase_21 AC 87 ms
16,268 KB
testcase_22 AC 91 ms
17,408 KB
testcase_23 AC 120 ms
21,224 KB
testcase_24 AC 127 ms
23,400 KB
testcase_25 AC 162 ms
26,832 KB
testcase_26 AC 156 ms
26,772 KB
testcase_27 AC 128 ms
24,268 KB
testcase_28 AC 151 ms
26,868 KB
testcase_29 AC 154 ms
26,832 KB
testcase_30 AC 152 ms
26,608 KB
testcase_31 AC 157 ms
26,468 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
x=gets.split.map(&:to_i).sort.uniq
m=x.size
res=n>m ? 'NO' : 'YES'
(1..m-1).each{|i| res='NO' if x[i]-x[i-1]!=x[1]-x[0]}
puts res
0