結果

問題 No.185 和風
ユーザー 👑 colognecologne
提出日時 2022-08-29 18:44:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 264 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 61,312 KB
最終ジャッジ日時 2024-04-24 08:50:04
合計ジャッジ時間 1,178 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
53,504 KB
testcase_01 AC 58 ms
61,312 KB
testcase_02 AC 58 ms
61,312 KB
testcase_03 AC 58 ms
61,056 KB
testcase_04 AC 58 ms
61,056 KB
testcase_05 AC 40 ms
52,480 KB
testcase_06 AC 58 ms
61,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    z = None
    for i in range(int(input())):
        a, b = map(int, input().split())
        x = b-a
        if (z is None or z == x) and x > 0:
            z = x
        else:
            z = -1
    print(z)


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