結果

問題 No.185 和風
ユーザー Cyberdog-しばいぬ-Cyberdog-しばいぬ-
提出日時 2019-02-09 01:08:48
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 18 ms / 1,000 ms
コード長 275 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 8,516 KB
最終ジャッジ日時 2023-09-14 04:02:08
合計ジャッジ時間 980 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,844 KB
testcase_01 AC 16 ms
8,440 KB
testcase_02 AC 15 ms
8,496 KB
testcase_03 AC 16 ms
8,516 KB
testcase_04 AC 18 ms
8,368 KB
testcase_05 AC 14 ms
8,096 KB
testcase_06 AC 16 ms
8,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
a = [input().split() for i in range(N)]
tmp = int(a[0][1]) - int(a[0][0])
for i in range(N):
    if int(a[i][1]) - int(a[i][0]) != tmp:
        print(-1)
        exit()
    tmp = int(a[i][1]) - int(a[i][0])
if tmp < 1:
    print("-1")
    exit()

print(tmp)
0