結果

問題 No.185 和風
ユーザー neko_the_shadow
提出日時 2017-03-25 23:22:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 318 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-06 06:17:05
合計ジャッジ時間 757 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(matrix):
    pivot_x, pivot_y = matrix[0]
    pivot = pivot_y - pivot_x

    for x, y in matrix:
        if x >= y or y - x != pivot: return -1

    return pivot

if __name__ == '__main__':
    n = int(input())
    matrix = tuple(tuple(map(int, input().split())) for _ in range(n))

    print(solve(matrix))
0