結果

問題 No.406 鴨等間隔の法則
ユーザー koba-e964koba-e964
提出日時 2016-08-05 22:37:42
言語 Ruby
(3.3.0)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 122 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 11,440 KB
実行使用メモリ 23,524 KB
最終ジャッジ日時 2023-09-21 17:44:28
合計ジャッジ時間 5,182 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
18,304 KB
testcase_01 AC 82 ms
15,284 KB
testcase_02 AC 82 ms
15,132 KB
testcase_03 AC 84 ms
15,276 KB
testcase_04 AC 132 ms
22,472 KB
testcase_05 AC 102 ms
17,812 KB
testcase_06 AC 102 ms
17,896 KB
testcase_07 AC 103 ms
18,144 KB
testcase_08 AC 129 ms
22,412 KB
testcase_09 AC 142 ms
23,336 KB
testcase_10 AC 104 ms
18,180 KB
testcase_11 AC 124 ms
21,500 KB
testcase_12 AC 110 ms
19,204 KB
testcase_13 AC 108 ms
19,052 KB
testcase_14 AC 137 ms
21,840 KB
testcase_15 AC 85 ms
15,556 KB
testcase_16 AC 84 ms
15,600 KB
testcase_17 AC 84 ms
15,484 KB
testcase_18 AC 84 ms
15,308 KB
testcase_19 AC 91 ms
15,408 KB
testcase_20 AC 89 ms
15,748 KB
testcase_21 AC 88 ms
15,952 KB
testcase_22 AC 96 ms
16,796 KB
testcase_23 AC 112 ms
19,452 KB
testcase_24 AC 130 ms
20,976 KB
testcase_25 AC 142 ms
23,524 KB
testcase_26 AC 156 ms
23,504 KB
testcase_27 AC 143 ms
23,376 KB
testcase_28 AC 133 ms
23,496 KB
testcase_29 AC 156 ms
23,448 KB
testcase_30 AC 153 ms
23,412 KB
testcase_31 AC 140 ms
22,976 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i;c=gets.split.map(&:to_i).sort
puts(if(0..n-2).find{|v|c[v+1]-c[v]!=c[1]-c[0]}||c[1]==c[0]then"NO"else"YES"end)
0