結果

問題 No.185 和風
ユーザー vwxyzvwxyz
提出日時 2022-04-18 21:32:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 285 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 9,836 KB
最終ジャッジ日時 2023-08-28 18:05:05
合計ジャッジ時間 1,084 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
9,688 KB
testcase_01 AC 33 ms
9,836 KB
testcase_02 AC 31 ms
9,724 KB
testcase_03 AC 31 ms
9,728 KB
testcase_04 AC 32 ms
9,672 KB
testcase_05 AC 31 ms
9,660 KB
testcase_06 AC 32 ms
9,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from typing import Counter
readline=sys.stdin.readline

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