結果

問題 No.406 鴨等間隔の法則
ユーザー gemmarogemmaro
提出日時 2019-10-24 18:26:13
言語 Ruby
(3.3.0)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 192 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 11,300 KB
実行使用メモリ 26,252 KB
最終ジャッジ日時 2023-09-21 19:09:48
合計ジャッジ時間 5,163 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
19,488 KB
testcase_01 AC 75 ms
15,188 KB
testcase_02 AC 76 ms
15,136 KB
testcase_03 AC 75 ms
15,044 KB
testcase_04 AC 145 ms
24,908 KB
testcase_05 AC 103 ms
18,776 KB
testcase_06 AC 103 ms
18,968 KB
testcase_07 AC 104 ms
19,156 KB
testcase_08 AC 139 ms
24,556 KB
testcase_09 AC 155 ms
26,096 KB
testcase_10 AC 107 ms
19,528 KB
testcase_11 AC 131 ms
22,932 KB
testcase_12 AC 115 ms
20,112 KB
testcase_13 AC 111 ms
20,004 KB
testcase_14 AC 134 ms
23,224 KB
testcase_15 AC 79 ms
15,616 KB
testcase_16 AC 81 ms
15,604 KB
testcase_17 AC 80 ms
15,560 KB
testcase_18 AC 82 ms
15,840 KB
testcase_19 AC 82 ms
15,864 KB
testcase_20 AC 84 ms
16,148 KB
testcase_21 AC 85 ms
16,260 KB
testcase_22 AC 91 ms
17,148 KB
testcase_23 AC 116 ms
20,560 KB
testcase_24 AC 129 ms
22,168 KB
testcase_25 AC 156 ms
26,204 KB
testcase_26 AC 154 ms
26,028 KB
testcase_27 AC 143 ms
26,008 KB
testcase_28 AC 145 ms
26,252 KB
testcase_29 AC 154 ms
26,096 KB
testcase_30 AC 153 ms
25,892 KB
testcase_31 AC 153 ms
26,008 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
xs = gets.chomp.split.map(&:to_i).sort

distances = []
xs.each_cons(2) {|left, right|
    distances << right - left
}

puts (distances.uniq.size <= 1 and distances[0] != 0) ? "YES" : "NO"
0