結果

問題 No.1120 Strange Teacher
ユーザー 👑 KazunKazun
提出日時 2020-07-22 21:41:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 275 bytes
コンパイル時間 1,058 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 101,328 KB
最終ジャッジ日時 2023-09-04 16:37:21
合計ジャッジ時間 5,388 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 74 ms
70,716 KB
testcase_10 AC 119 ms
100,516 KB
testcase_11 AC 121 ms
100,452 KB
testcase_12 AC 120 ms
100,464 KB
testcase_13 AC 119 ms
101,004 KB
testcase_14 AC 120 ms
100,552 KB
testcase_15 AC 120 ms
100,464 KB
testcase_16 AC 122 ms
100,520 KB
testcase_17 AC 123 ms
100,680 KB
testcase_18 AC 74 ms
70,768 KB
testcase_19 AC 121 ms
100,092 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 74 ms
70,592 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 73 ms
70,996 KB
testcase_26 AC 74 ms
70,612 KB
testcase_27 AC 74 ms
71,052 KB
testcase_28 AC 74 ms
70,848 KB
testcase_29 AC 75 ms
71,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

D=[A[i]-B[i] for i in range(N)]
E=sum(D)

F=True
H=0
for i in range(N):
    X=E-2*D[i]
    if X>=0 and X%N==0:
        H+=X//N
    else:
        F=False

if F:
    print(H)
else:
    print(-1)
0