結果

問題 No.185 和風
ユーザー alcoholamp
提出日時 2019-10-29 12:18:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 339 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-14 21:26:28
合計ジャッジ時間 1,055 ms
ジャッジサーバーID
(参考情報)
judge1 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

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