結果

問題 No.185 和風
ユーザー trineutrontrineutron
提出日時 2020-04-09 18:01:41
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 18 ms / 1,000 ms
コード長 241 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 7,920 KB
最終ジャッジ日時 2023-10-11 16:28:35
合計ジャッジ時間 789 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

n = int(input())
d = -1
for i in range(n):
    x, y = map(int, input().split())
    if i == 0:
        d = y - x
        if d <= 0:
            print(-1)
            break
    if d != y - x:
        print(-1)
        break
else:
    print(d)
0