結果

問題 No.909 たぴの配置
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-22 10:40:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 220 ms / 3,000 ms
コード長 323 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 133,416 KB
最終ジャッジ日時 2023-08-27 00:57:03
合計ジャッジ時間 6,880 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,352 KB
testcase_01 AC 67 ms
71,196 KB
testcase_02 AC 68 ms
71,368 KB
testcase_03 AC 67 ms
71,548 KB
testcase_04 AC 67 ms
71,324 KB
testcase_05 AC 220 ms
130,652 KB
testcase_06 AC 204 ms
133,416 KB
testcase_07 AC 193 ms
124,492 KB
testcase_08 AC 207 ms
130,716 KB
testcase_09 AC 204 ms
133,228 KB
testcase_10 AC 188 ms
125,172 KB
testcase_11 AC 195 ms
124,008 KB
testcase_12 AC 197 ms
130,676 KB
testcase_13 AC 204 ms
132,516 KB
testcase_14 AC 190 ms
124,440 KB
testcase_15 AC 193 ms
124,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
X = tuple(map(int, input().split()))
Y = tuple(map(int, input().split()))
ans = min(x + y for x, y in zip(X, Y))

pos = [0] * (n + 2)
pos[n + 1] = ans
for i, (x, y) in enumerate(zip(X, Y), 1):
    if x < y:
        pos[i] = min(ans, x)
    else:
        pos[i] = max(0, ans - y)

print(ans, *pos, sep="\n")
0