結果

問題 No.185 和風
ユーザー ゆるくゆるく
提出日時 2015-04-23 23:50:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 1,000 ms
コード長 305 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 7,800 KB
最終ジャッジ日時 2023-09-18 08:47:02
合計ジャッジ時間 1,174 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,732 KB
testcase_01 AC 18 ms
7,800 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 15 ms
7,716 KB
testcase_04 AC 15 ms
7,720 KB
testcase_05 AC 15 ms
7,716 KB
testcase_06 AC 19 ms
7,772 KB
権限があれば一括ダウンロードができます

ソースコード

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