結果

問題 No.1120 Strange Teacher
ユーザー irumo8202
提出日時 2022-01-26 20:14:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 236 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 103,808 KB
最終ジャッジ日時 2024-12-23 14:25:16
合計ジャッジ時間 3,942 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

mx = 0
for a, b in zip(A, B):
    mx = max(mx, a - b)

ans = 0
for a, b in zip(A, B):
    ans += mx - (a - b)

print(mx if ans == mx * 2 else -1)
0