結果

問題 No.185 和風
ユーザー ゆるく
提出日時 2015-04-23 23:50:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 1,000 ms
コード長 305 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-05 00:41:08
合計ジャッジ時間 1,016 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x1, y1 = map(int, input().split())
z = max(y1 - x1, -1)
z = z if z > 0 else -1
n -= 1
if n <= 0 or z <= -1:
    print(z)
else:
    for _ in range(n):
        x, y = map(int, input().split())
        tz = max(y - x, -1)
        if tz != z:
            z = -1
            break
    print(z)
0