結果

問題 No.1120 Strange Teacher
ユーザー stngstng
提出日時 2022-09-04 18:00:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 92,672 KB
最終ジャッジ日時 2024-04-29 18:12:05
合計ジャッジ時間 3,383 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 39 ms
51,584 KB
testcase_10 AC 99 ms
92,416 KB
testcase_11 AC 98 ms
92,288 KB
testcase_12 AC 99 ms
92,160 KB
testcase_13 AC 94 ms
92,416 KB
testcase_14 AC 93 ms
92,544 KB
testcase_15 AC 87 ms
91,392 KB
testcase_16 AC 95 ms
92,416 KB
testcase_17 AC 85 ms
91,264 KB
testcase_18 AC 37 ms
51,712 KB
testcase_19 AC 84 ms
92,672 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 40 ms
51,712 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 40 ms
51,456 KB
testcase_26 AC 39 ms
51,584 KB
testcase_27 AC 39 ms
51,584 KB
testcase_28 AC 39 ms
51,584 KB
testcase_29 AC 40 ms
51,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

li = [0]*n
ans = 0
for i in range(n):
    li[i] = b[i]-a[i]

li.sort(reverse=True)
ans = -li[n-1]

tmp = 0

for i in range(n-1):
    tmp += li[i]

if ans == -tmp:
    print(ans)
else:
    print(-1)
0