結果

問題 No.185 和風
ユーザー otsunekootsuneko
提出日時 2021-05-07 09:41:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 1,000 ms
コード長 273 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 75,464 KB
最終ジャッジ日時 2023-10-13 00:34:10
合計ジャッジ時間 1,607 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,416 KB
testcase_01 AC 88 ms
75,364 KB
testcase_02 AC 72 ms
71,076 KB
testcase_03 AC 71 ms
71,196 KB
testcase_04 AC 87 ms
75,444 KB
testcase_05 AC 77 ms
71,296 KB
testcase_06 AC 84 ms
75,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = -1
for _ in range(N):
    X,Y = map(int,input().split())
    if ans == -1:
        ans = Y-X
    else:
        if ans + X != Y:
            print(-1)
            break
else:
    if ans > 0:
        print(ans)
    else:
        print(-1)
0