結果

問題 No.185 和風
ユーザー knt3110knt3110
提出日時 2018-05-22 15:34:47
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 19 ms / 1,000 ms
コード長 267 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 8,376 KB
最終ジャッジ日時 2023-09-11 01:14:04
合計ジャッジ時間 862 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,836 KB
testcase_01 AC 19 ms
8,360 KB
testcase_02 AC 19 ms
8,308 KB
testcase_03 AC 18 ms
8,316 KB
testcase_04 AC 19 ms
8,376 KB
testcase_05 AC 15 ms
7,888 KB
testcase_06 AC 19 ms
8,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=[[int(i) for i in input().split()] for i in range(n)]
b=[0 for i in range(n)]

for i in range(len(a)):
     b[i]=a[i][1]-a[i][0]

jud=0
for i in range(n):
    if b[i]!=b[0] or b[i]<=0:
        jud+=1

if jud==0:
    print(b[0])
else:
    print(-1)


0