結果

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

テストケース

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

ソースコード

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(x - y)
        if len(g) > 1:
            print -1
        elif i == N - 1:
            print g.pop()
0