結果

問題 No.185 和風
ユーザー GrayCoderGrayCoder
提出日時 2017-10-09 07:52:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 1,000 ms
コード長 268 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 8,424 KB
最終ジャッジ日時 2023-08-10 20:48:38
合計ジャッジ時間 825 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,840 KB
testcase_01 AC 17 ms
8,332 KB
testcase_02 AC 16 ms
8,236 KB
testcase_03 AC 16 ms
8,316 KB
testcase_04 AC 16 ms
8,384 KB
testcase_05 AC 14 ms
7,804 KB
testcase_06 AC 16 ms
8,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    XY = tuple(tuple(map(int, input().split())) for _ in [0] * N)

    z = XY[0][1] - XY[0][0]
    for x, y in XY:
        if z != y - x or z <= 0:
            print(-1)
            break
    else:
        print(z)
            
main()
0