結果

問題 No.185 和風
ユーザー MitI_7MitI_7
提出日時 2015-10-31 22:37:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 339 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 7,944 KB
最終ジャッジ日時 2023-10-11 07:30:00
合計ジャッジ時間 1,085 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,904 KB
testcase_01 AC 20 ms
7,944 KB
testcase_02 AC 20 ms
7,868 KB
testcase_03 AC 20 ms
7,852 KB
testcase_04 AC 19 ms
7,852 KB
testcase_05 WA -
testcase_06 AC 19 ms
7,844 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