結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2016-06-06 10:21:16 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 93 ms / 1,000 ms |
| コード長 | 244 bytes |
| コンパイル時間 | 212 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-10-08 16:22:50 |
| 合計ジャッジ時間 | 1,446 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
コンパイルメッセージ
Main.rb:24: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
# your code goes here
n=STDIN.gets.to_i
d=-1
ok=true
n.times do |i|
a,b=STDIN.gets.split(" ")
a=a.to_i
b=b.to_i
if d==-1
if b>a
d=b-a
else
ok=false
end
else
if d!=b-a
ok=false
end
end
end
if ok
puts d
else
puts -1
end
horiesiniti