結果

問題 No.185 和風
ユーザー MitI_7MitI_7
提出日時 2015-10-31 22:38:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 1,000 ms
コード長 332 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 7,872 KB
最終ジャッジ日時 2023-10-11 07:32:33
合計ジャッジ時間 1,503 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,776 KB
testcase_01 AC 18 ms
7,792 KB
testcase_02 AC 18 ms
7,740 KB
testcase_03 AC 18 ms
7,864 KB
testcase_04 AC 18 ms
7,796 KB
testcase_05 AC 17 ms
7,872 KB
testcase_06 AC 18 ms
7,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    s = set()
    for _ in range(n):
        x, y = map(int, input().split())
        s.add(y - x)

    if len(s) == 1:
        ans = s.pop()
        if ans <= 0:
            print(-1)
        else:
            print(ans)
    else:
        print(-1)
    
    
if __name__ == '__main__':
    main()
0