結果

問題 No.185 和風
ユーザー utsumidaisukeutsumidaisuke
提出日時 2018-01-01 10:29:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 1,000 ms
コード長 247 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 7,932 KB
最終ジャッジ日時 2023-08-24 13:33:19
合計ジャッジ時間 1,068 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 18 ms
7,912 KB
testcase_02 AC 18 ms
7,932 KB
testcase_03 AC 18 ms
7,916 KB
testcase_04 AC 18 ms
7,884 KB
testcase_05 AC 15 ms
7,908 KB
testcase_06 AC 17 ms
7,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

ans = []
for i in range(n):
    y, a = [int(i) for i in input().split()]
    x = a - y
    ans.append(x)
    
b = set(ans)

if len(b) == 1:
    if min(b) <= 0:
        print(-1)
    else:
        print(min(b))
else:
    print(-1)
0