結果

問題 No.185 和風
ユーザー trineutron
提出日時 2020-04-09 18:01:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 241 bytes
コンパイル時間 454 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-13 15:09:06
合計ジャッジ時間 965 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
d = -1
for i in range(n):
    x, y = map(int, input().split())
    if i == 0:
        d = y - x
        if d <= 0:
            print(-1)
            break
    if d != y - x:
        print(-1)
        break
else:
    print(d)
0