結果

問題 No.406 鴨等間隔の法則
ユーザー simansiman
提出日時 2020-06-03 21:45:26
言語 Ruby
(3.3.0)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 155 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 11,476 KB
実行使用メモリ 25,988 KB
最終ジャッジ日時 2023-08-17 06:11:39
合計ジャッジ時間 6,625 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
19,544 KB
testcase_01 AC 76 ms
15,344 KB
testcase_02 AC 76 ms
15,148 KB
testcase_03 AC 77 ms
15,140 KB
testcase_04 AC 119 ms
24,896 KB
testcase_05 AC 94 ms
18,844 KB
testcase_06 AC 94 ms
18,964 KB
testcase_07 AC 95 ms
18,904 KB
testcase_08 AC 115 ms
24,956 KB
testcase_09 AC 129 ms
25,940 KB
testcase_10 AC 98 ms
19,340 KB
testcase_11 AC 113 ms
23,488 KB
testcase_12 AC 102 ms
20,568 KB
testcase_13 AC 101 ms
20,180 KB
testcase_14 AC 144 ms
24,140 KB
testcase_15 AC 80 ms
15,404 KB
testcase_16 AC 82 ms
15,556 KB
testcase_17 AC 80 ms
15,372 KB
testcase_18 AC 82 ms
16,036 KB
testcase_19 AC 86 ms
15,820 KB
testcase_20 AC 88 ms
16,140 KB
testcase_21 AC 89 ms
16,144 KB
testcase_22 AC 95 ms
17,020 KB
testcase_23 AC 104 ms
20,936 KB
testcase_24 AC 136 ms
23,060 KB
testcase_25 AC 129 ms
25,988 KB
testcase_26 AC 164 ms
25,876 KB
testcase_27 AC 125 ms
22,896 KB
testcase_28 AC 130 ms
25,880 KB
testcase_29 AC 167 ms
25,872 KB
testcase_30 AC 166 ms
25,988 KB
testcase_31 AC 129 ms
25,724 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
X = gets.split.map(&:to_i)

if X.uniq.size == N && X.sort.each_cons(2).map { |a, b| b - a }.uniq.size == 1
  puts 'YES'
else
  puts 'NO'
end
0