結果

問題 No.406 鴨等間隔の法則
ユーザー jiro8719jiro8719
提出日時 2018-07-12 16:14:28
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 258 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 20,480 KB
最終ジャッジ日時 2024-04-10 04:44:36
合計ジャッジ時間 5,741 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
15,488 KB
testcase_01 RE -
testcase_02 AC 87 ms
12,160 KB
testcase_03 AC 87 ms
12,160 KB
testcase_04 AC 139 ms
19,712 KB
testcase_05 AC 105 ms
14,592 KB
testcase_06 AC 104 ms
14,848 KB
testcase_07 AC 107 ms
14,848 KB
testcase_08 AC 138 ms
19,328 KB
testcase_09 AC 144 ms
19,968 KB
testcase_10 AC 110 ms
15,488 KB
testcase_11 AC 134 ms
18,560 KB
testcase_12 AC 115 ms
16,128 KB
testcase_13 AC 111 ms
15,872 KB
testcase_14 RE -
testcase_15 AC 92 ms
12,416 KB
testcase_16 AC 93 ms
12,416 KB
testcase_17 AC 89 ms
12,288 KB
testcase_18 AC 91 ms
12,416 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 92 ms
12,928 KB
testcase_22 RE -
testcase_23 AC 114 ms
16,384 KB
testcase_24 RE -
testcase_25 AC 142 ms
20,096 KB
testcase_26 RE -
testcase_27 AC 131 ms
20,224 KB
testcase_28 AC 133 ms
20,096 KB
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 143 ms
19,840 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

num = gets.to_i
list = gets.split(" ").map(&:to_i).sort
a = list[0] - list[1]
for i in 2..num-1
    if list[i] - list[i+1] != a || list[i] - list[i+1] == 0
        puts "NO"
        break
    end
    if i == num-1
        puts "YES"
        break
    end
end
0