結果

問題 No.185 和風
ユーザー WatsonWatson
提出日時 2017-07-27 14:57:50
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 19 ms / 1,000 ms
コード長 273 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 7,924 KB
最終ジャッジ日時 2023-07-31 08:23:09
合計ジャッジ時間 894 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,924 KB
testcase_01 AC 18 ms
7,792 KB
testcase_02 AC 18 ms
7,856 KB
testcase_03 AC 19 ms
7,784 KB
testcase_04 AC 18 ms
7,856 KB
testcase_05 AC 16 ms
7,860 KB
testcase_06 AC 18 ms
7,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = 0
ng  = 0
X = [int(i) for i in input().split()]
ans = X[1]-X[0]
for i in range(N-1):
    X = [int(i) for i in input().split()]
    if ans !=  X[1]-X[0]:
        ng = -1
if ans <= 0:
    print("-1")
elif ng == -1:
    print("-1")
else:
    print(ans)
0