結果

問題 No.185 和風
ユーザー fshutofshuto
提出日時 2019-04-30 10:14:09
言語 Ruby
(3.2.2)
結果
AC  
実行時間 82 ms / 1,000 ms
コード長 189 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 11,360 KB
実行使用メモリ 15,316 KB
最終ジャッジ日時 2023-08-27 23:17:45
合計ジャッジ時間 2,138 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,176 KB
testcase_01 AC 82 ms
15,156 KB
testcase_02 AC 80 ms
15,012 KB
testcase_03 AC 79 ms
15,316 KB
testcase_04 AC 81 ms
15,140 KB
testcase_05 AC 80 ms
15,176 KB
testcase_06 AC 82 ms
15,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:5: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Main.rb:11: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

n = gets.to_i
x, y = gets.split.map(&:to_i)
a = y - x
if a <= 0
  puts -1
  exit
end
(n-1).times do
  x, y = gets.split.map(&:to_i)
  unless y - x == a
    puts -1
    exit
  end
end
puts a
0