結果

問題 No.185 和風
ユーザー dangodango
提出日時 2023-06-05 16:29:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 8,324 KB
最終ジャッジ日時 2023-08-28 09:38:13
合計ジャッジ時間 797 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,856 KB
testcase_01 AC 19 ms
8,176 KB
testcase_02 AC 18 ms
8,236 KB
testcase_03 AC 18 ms
8,316 KB
testcase_04 AC 18 ms
8,324 KB
testcase_05 WA -
testcase_06 AC 18 ms
8,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def CHECK(N, XYS):
  if XYS[0][0] > XYS[0][1]:
    return False
  S = XYS[0][1] - XYS[0][0]
  for I in range(1, N):
    if XYS[I][0] > XYS[I][1]:
      return False
    else:
      if S != (XYS[I][1] - XYS[I][0]):
        return False
  return True
N = int(input())
XYS = []
for _ in range(N):
  Xi, Yi = map(int, input().split())
  XYS.append([Xi, Yi])
if CHECK(N, XYS):
  print(XYS[0][1] - XYS[0][0])
else:
  print(-1)
0