結果

問題 No.185 和風
ユーザー HIROPON87069639
提出日時 2016-02-23 23:08:44
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 1,000 ms
コード長 241 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-09-22 13:14:58
合計ジャッジ時間 778 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
N = input()
B = 0
for i in range(0, N):
    X, Y = map(int, raw_input().split())
    A  = Y - X
    if A != B and 0 < i:
        print -1
        exit()
    if A <= 0:
        print -1
        exit()
    B = A
print A
0