結果

問題 No.406 鴨等間隔の法則
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2019-11-01 14:01:33
言語 Ruby
(3.3.0)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 128 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 11,304 KB
実行使用メモリ 25,984 KB
最終ジャッジ日時 2023-09-21 19:09:42
合計ジャッジ時間 5,045 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
18,200 KB
testcase_01 AC 78 ms
15,112 KB
testcase_02 AC 78 ms
15,292 KB
testcase_03 AC 78 ms
15,348 KB
testcase_04 AC 128 ms
22,408 KB
testcase_05 AC 101 ms
17,852 KB
testcase_06 AC 100 ms
17,848 KB
testcase_07 AC 101 ms
17,848 KB
testcase_08 AC 126 ms
22,344 KB
testcase_09 AC 138 ms
23,592 KB
testcase_10 AC 101 ms
18,092 KB
testcase_11 AC 120 ms
21,548 KB
testcase_12 AC 107 ms
19,076 KB
testcase_13 AC 105 ms
19,036 KB
testcase_14 AC 145 ms
21,808 KB
testcase_15 AC 80 ms
15,480 KB
testcase_16 AC 81 ms
15,536 KB
testcase_17 AC 80 ms
15,204 KB
testcase_18 AC 82 ms
15,340 KB
testcase_19 AC 85 ms
15,608 KB
testcase_20 AC 88 ms
16,232 KB
testcase_21 AC 85 ms
15,984 KB
testcase_22 AC 95 ms
16,688 KB
testcase_23 AC 108 ms
19,432 KB
testcase_24 AC 136 ms
21,504 KB
testcase_25 AC 137 ms
23,496 KB
testcase_26 AC 161 ms
25,724 KB
testcase_27 AC 125 ms
23,372 KB
testcase_28 AC 125 ms
23,472 KB
testcase_29 AC 162 ms
25,984 KB
testcase_30 AC 159 ms
25,696 KB
testcase_31 AC 135 ms
23,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
X = gets.split.map(&:to_i).sort
d = X[1] - X[0]
puts d > 0 && X.each_cons(2).all?{|a,b| a + d == b } ? :YES : :NO
0