結果

問題 No.1120 Strange Teacher
ユーザー irumo8202irumo8202
提出日時 2022-01-26 20:14:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 236 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 101,412 KB
最終ジャッジ日時 2023-08-25 02:22:01
合計ジャッジ時間 6,820 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 112 ms
101,224 KB
testcase_05 AC 114 ms
101,248 KB
testcase_06 AC 115 ms
101,276 KB
testcase_07 AC 114 ms
101,252 KB
testcase_08 AC 118 ms
101,264 KB
testcase_09 AC 70 ms
71,392 KB
testcase_10 AC 114 ms
101,212 KB
testcase_11 AC 114 ms
101,248 KB
testcase_12 AC 113 ms
101,412 KB
testcase_13 AC 114 ms
101,172 KB
testcase_14 AC 114 ms
101,180 KB
testcase_15 AC 113 ms
101,140 KB
testcase_16 AC 113 ms
101,192 KB
testcase_17 AC 113 ms
101,236 KB
testcase_18 AC 67 ms
71,396 KB
testcase_19 AC 112 ms
100,424 KB
testcase_20 AC 71 ms
71,568 KB
testcase_21 AC 68 ms
71,212 KB
testcase_22 AC 72 ms
71,560 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 69 ms
71,556 KB
testcase_26 AC 70 ms
71,304 KB
testcase_27 AC 69 ms
71,260 KB
testcase_28 AC 69 ms
71,332 KB
testcase_29 AC 70 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

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