結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
18,276 KB
testcase_01 AC 81 ms
15,264 KB
testcase_02 AC 82 ms
15,328 KB
testcase_03 AC 80 ms
15,136 KB
testcase_04 AC 131 ms
22,672 KB
testcase_05 AC 100 ms
17,760 KB
testcase_06 AC 102 ms
17,820 KB
testcase_07 AC 103 ms
17,896 KB
testcase_08 AC 128 ms
22,560 KB
testcase_09 AC 144 ms
23,392 KB
testcase_10 AC 109 ms
18,328 KB
testcase_11 AC 128 ms
21,488 KB
testcase_12 AC 114 ms
19,172 KB
testcase_13 AC 110 ms
18,956 KB
testcase_14 AC 138 ms
21,804 KB
testcase_15 AC 83 ms
15,340 KB
testcase_16 AC 84 ms
15,552 KB
testcase_17 AC 83 ms
15,316 KB
testcase_18 AC 84 ms
15,576 KB
testcase_19 AC 86 ms
15,424 KB
testcase_20 AC 88 ms
15,788 KB
testcase_21 AC 87 ms
15,956 KB
testcase_22 AC 98 ms
16,720 KB
testcase_23 AC 113 ms
19,740 KB
testcase_24 AC 130 ms
20,864 KB
testcase_25 AC 142 ms
23,664 KB
testcase_26 AC 154 ms
23,580 KB
testcase_27 AC 143 ms
23,260 KB
testcase_28 AC 132 ms
23,544 KB
testcase_29 AC 154 ms
23,676 KB
testcase_30 AC 153 ms
23,180 KB
testcase_31 AC 140 ms
23,148 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