結果

問題 No.185 和風
コンテスト
ユーザー netyo715
提出日時 2021-06-21 10:15:34
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 22 ms / 1,000 ms
+ 509µs
コード長 218 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 60 ms
コンパイル使用メモリ 15,360 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-10-11 08:24:37
合計ジャッジ時間 1,223 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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