結果

問題 No.185 和風
ユーザー ondy_candyondy_candy
提出日時 2018-01-12 01:13:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 22 ms / 1,000 ms
コード長 397 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 7,940 KB
最終ジャッジ日時 2023-08-25 11:00:35
合計ジャッジ時間 1,260 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

# coding: utf-8

def main():

    n = int(input())
    
    result = -1

    for i in range(n):
        x, y = [int(j) for j in input().split()]
        z = y - x
        if z <= 0:
            break
        if result == -1:
            result = z
        else:
            if result != z:
                result = -1
                break

    print(result) 

if __name__=='__main__':
    main()
0