結果

問題 No.185 和風
ユーザー hkawa117hkawa117
提出日時 2015-09-07 23:00:28
言語 Python2
(2.7.18)
結果
AC  
実行時間 15 ms / 1,000 ms
コード長 278 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 6,520 KB
実行使用メモリ 6,072 KB
最終ジャッジ日時 2023-09-26 10:02:48
合計ジャッジ時間 770 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
5,848 KB
testcase_01 AC 15 ms
5,912 KB
testcase_02 AC 12 ms
6,072 KB
testcase_03 AC 11 ms
5,912 KB
testcase_04 AC 11 ms
5,956 KB
testcase_05 AC 11 ms
5,960 KB
testcase_06 AC 14 ms
5,960 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
            break
    
    if i == N - 1:
        print g.pop()
0