結果

問題 No.185 和風
ユーザー na-shna-sh
提出日時 2020-07-13 17:39:29
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 18 ms / 1,000 ms
コード長 249 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 7,888 KB
最終ジャッジ日時 2023-08-07 16:40:52
合計ジャッジ時間 746 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,872 KB
testcase_01 AC 18 ms
7,760 KB
testcase_02 AC 15 ms
7,772 KB
testcase_03 AC 16 ms
7,768 KB
testcase_04 AC 15 ms
7,888 KB
testcase_05 AC 15 ms
7,856 KB
testcase_06 AC 18 ms
7,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

X, Y = map(int, input().split())
a = Y - X

if a <= 0:
    print(-1)
else:
    for i in range(N-1):
        x, y = map(int, input().split())
        if a != y - x:
            print(-1)
            break
    else:
        print(a)
0