結果

問題 No.185 和風
ユーザー tookunn_1213tookunn_1213
提出日時 2015-06-06 19:38:49
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 1,000 ms
コード長 188 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 6,484 KB
実行使用メモリ 5,932 KB
最終ジャッジ日時 2023-09-20 19:34:32
合計ジャッジ時間 775 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,908 KB
testcase_01 AC 14 ms
5,920 KB
testcase_02 AC 12 ms
5,908 KB
testcase_03 AC 11 ms
5,920 KB
testcase_04 AC 13 ms
5,932 KB
testcase_05 AC 11 ms
5,824 KB
testcase_06 AC 13 ms
5,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
ans = -1
for i in range(N):
	x,y = map(int,raw_input().split())
	if i == 0:
		ans = y - x;
	else:
		if ans != y - x:
			ans = -1
			break
print -1 if ans <= 0 else ans
0