結果

問題 No.1120 Strange Teacher
ユーザー now4est
提出日時 2020-07-23 12:52:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 268 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 47,304 KB
最終ジャッジ日時 2024-06-23 17:30:13
合計ジャッジ時間 17,260 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N = int(input())
A = np.array(input().split(), dtype=np.int64)
B = np.array(input().split(), dtype=np.int64)

ans = -1
v = (A.sum() - B.sum()) / (N - 2)

if ((B - A + v) % 2 == 0).all() and ((B - A + v) / 2).sum() == v:
    ans = int(v)

print(ans)
0