結果

問題 No.185 和風
ユーザー hkawa117hkawa117
提出日時 2015-09-07 22:52:49
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 6,704 KB
実行使用メモリ 6,100 KB
最終ジャッジ日時 2023-09-26 10:02:46
合計ジャッジ時間 768 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,012 KB
testcase_01 AC 13 ms
5,912 KB
testcase_02 AC 10 ms
6,072 KB
testcase_03 WA -
testcase_04 AC 11 ms
6,100 KB
testcase_05 AC 11 ms
6,088 KB
testcase_06 AC 13 ms
6,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
g = set([])
for i in range(N):
    x, y = map(int, raw_input().split())
    if x >= y:
        print -1
        break
    else:
        g.add(y - x)
        if len(g) > 1:
            print -1
        elif i == N - 1:
            print g.pop()
0