結果

問題 No.185 和風
ユーザー matsu7874matsu7874
提出日時 2015-10-07 13:43:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 20 ms / 1,000 ms
コード長 223 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 8,144 KB
最終ジャッジ日時 2023-09-27 07:43:51
合計ジャッジ時間 817 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
7,860 KB
testcase_01 AC 20 ms
8,052 KB
testcase_02 AC 16 ms
8,144 KB
testcase_03 AC 16 ms
8,044 KB
testcase_04 AC 19 ms
7,772 KB
testcase_05 AC 16 ms
7,772 KB
testcase_06 AC 18 ms
7,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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