結果

問題 No.406 鴨等間隔の法則
ユーザー 👑 hos.lyrichos.lyric
提出日時 2020-04-09 22:30:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 106 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 11,196 KB
実行使用メモリ 23,652 KB
最終ジャッジ日時 2023-10-12 00:04:58
合計ジャッジ時間 6,256 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
18,140 KB
testcase_01 AC 81 ms
15,084 KB
testcase_02 AC 81 ms
15,136 KB
testcase_03 AC 81 ms
15,308 KB
testcase_04 AC 132 ms
22,388 KB
testcase_05 AC 101 ms
17,692 KB
testcase_06 AC 102 ms
17,740 KB
testcase_07 AC 102 ms
18,128 KB
testcase_08 AC 130 ms
22,540 KB
testcase_09 AC 143 ms
23,340 KB
testcase_10 AC 105 ms
18,080 KB
testcase_11 AC 126 ms
21,544 KB
testcase_12 AC 112 ms
19,312 KB
testcase_13 AC 109 ms
19,100 KB
testcase_14 AC 136 ms
21,776 KB
testcase_15 AC 85 ms
15,260 KB
testcase_16 AC 85 ms
15,440 KB
testcase_17 AC 84 ms
15,312 KB
testcase_18 AC 86 ms
15,548 KB
testcase_19 AC 88 ms
15,516 KB
testcase_20 AC 90 ms
15,844 KB
testcase_21 AC 87 ms
16,028 KB
testcase_22 AC 94 ms
16,880 KB
testcase_23 AC 113 ms
19,568 KB
testcase_24 AC 128 ms
20,892 KB
testcase_25 AC 145 ms
23,652 KB
testcase_26 AC 153 ms
23,452 KB
testcase_27 AC 133 ms
23,452 KB
testcase_28 AC 132 ms
23,436 KB
testcase_29 AC 154 ms
23,472 KB
testcase_30 AC 152 ms
23,124 KB
testcase_31 AC 144 ms
23,008 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
x=gets.split.map(&:to_i).sort
d=x[1]-x[0]
puts d>0&&(1...n).all?{|i|d==x[i]-x[i-1]}?:YES: :NO
0