結果

問題 No.1120 Strange Teacher
ユーザー stngstng
提出日時 2022-09-04 17:59:53
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 293 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 94,848 KB
最終ジャッジ日時 2024-04-29 18:11:37
合計ジャッジ時間 4,246 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 41 ms
51,840 KB
testcase_19 AC 88 ms
92,544 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 42 ms
51,968 KB
testcase_28 AC 42 ms
51,968 KB
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

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(a[n])
0