結果

問題 No.406 鴨等間隔の法則
ユーザー fshutofshuto
提出日時 2019-04-18 08:33:20
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 161 bytes
コンパイル時間 429 ms
コンパイル使用メモリ 11,916 KB
実行使用メモリ 24,388 KB
最終ジャッジ日時 2023-10-22 07:40:32
合計ジャッジ時間 6,751 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
19,288 KB
testcase_01 AC 82 ms
16,040 KB
testcase_02 AC 83 ms
16,040 KB
testcase_03 WA -
testcase_04 AC 138 ms
23,248 KB
testcase_05 AC 103 ms
18,736 KB
testcase_06 AC 105 ms
18,936 KB
testcase_07 AC 105 ms
19,020 KB
testcase_08 AC 130 ms
23,160 KB
testcase_09 AC 141 ms
24,292 KB
testcase_10 AC 107 ms
19,288 KB
testcase_11 AC 125 ms
22,252 KB
testcase_12 AC 113 ms
19,984 KB
testcase_13 AC 109 ms
19,740 KB
testcase_14 AC 132 ms
22,580 KB
testcase_15 WA -
testcase_16 AC 85 ms
16,300 KB
testcase_17 AC 84 ms
16,088 KB
testcase_18 AC 86 ms
16,300 KB
testcase_19 AC 87 ms
16,300 KB
testcase_20 AC 91 ms
16,720 KB
testcase_21 AC 89 ms
16,720 KB
testcase_22 AC 94 ms
17,624 KB
testcase_23 AC 112 ms
20,364 KB
testcase_24 AC 128 ms
21,876 KB
testcase_25 AC 143 ms
24,376 KB
testcase_26 AC 153 ms
24,388 KB
testcase_27 WA -
testcase_28 AC 133 ms
24,380 KB
testcase_29 AC 154 ms
24,388 KB
testcase_30 AC 149 ms
24,088 KB
testcase_31 AC 139 ms
23,840 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
xs = gets.split.map(&:to_i).sort
diff = xs[1] - xs[0]
(1..N-2).each do |i|
  if xs[i+1] - xs[i] != diff
    puts 'NO'
    exit
  end
end
puts 'YES'
0