結果

問題 No.185 和風
ユーザー alcoholampalcoholamp
提出日時 2019-10-29 12:18:06
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 19 ms / 1,000 ms
コード長 339 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 7,948 KB
最終ジャッジ日時 2023-10-12 23:19:12
合計ジャッジ時間 1,108 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,820 KB
testcase_01 AC 18 ms
7,868 KB
testcase_02 AC 19 ms
7,872 KB
testcase_03 AC 18 ms
7,788 KB
testcase_04 AC 19 ms
7,740 KB
testcase_05 AC 16 ms
7,948 KB
testcase_06 AC 18 ms
7,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class Problem0185:
	def solve(this):
		n = int(input())
		
		c = True
		res = set()
		for i in range(n):
			x, y = map(int, input().split())
			if x >= y:
				c = False
			res.add(y - x)
		if c and len(res) == 1:
			t = list(res)
			print(t[0])
		else:
			print(-1)
			
if __name__ == "__main__":
	problem = Problem0185()
	problem.solve()
0