結果

問題 No.185 和風
ユーザー m_yukihirom_yukihiro
提出日時 2015-04-25 18:46:53
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 273 bytes
コンパイル時間 50 ms
コンパイル使用メモリ 6,712 KB
実行使用メモリ 6,168 KB
最終ジャッジ日時 2023-09-18 11:24:53
合計ジャッジ時間 773 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,088 KB
testcase_01 AC 15 ms
5,976 KB
testcase_02 AC 13 ms
6,056 KB
testcase_03 AC 14 ms
5,996 KB
testcase_04 AC 14 ms
6,028 KB
testcase_05 WA -
testcase_06 AC 14 ms
6,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

num = input()

a, b = raw_input().split(" ")
ans = int(b) - int(a)

flag = False
for i in xrange(num-1):
    a, b = raw_input().split(" ")
    tmp = int(b) - int(a)

    if ans != tmp:
        flag = True
        break

if ans < 0 or flag:
    print -1
else:
    print ans
0