結果

問題 No.909 たぴの配置
ユーザー ああいいああいい
提出日時 2022-06-12 18:24:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 3,000 ms
コード長 478 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 110,268 KB
最終ジャッジ日時 2023-10-24 12:22:14
合計ジャッジ時間 4,095 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,424 KB
testcase_01 AC 35 ms
53,424 KB
testcase_02 AC 36 ms
53,424 KB
testcase_03 AC 36 ms
53,424 KB
testcase_04 AC 35 ms
53,424 KB
testcase_05 AC 138 ms
110,012 KB
testcase_06 AC 140 ms
110,268 KB
testcase_07 AC 134 ms
106,468 KB
testcase_08 AC 152 ms
109,884 KB
testcase_09 AC 150 ms
110,120 KB
testcase_10 AC 140 ms
106,408 KB
testcase_11 AC 137 ms
106,312 KB
testcase_12 AC 139 ms
109,808 KB
testcase_13 AC 140 ms
110,152 KB
testcase_14 AC 133 ms
106,368 KB
testcase_15 AC 132 ms
106,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))

m = 10 ** 7
for i in range(N):
    t = X[i] + Y[i]
    if t < m:
        m = t
tapi = [0] * (N + 2)
tapi[-1] = m
for i in range(N):
    if X[i] <= m and Y[i] <= m:
        tapi[i + 1] = m - Y[i]
    elif X[i] > m and Y[i] <= m:
        tapi[i + 1] = m - Y[i]
    elif X[i] <= m and Y[i] > m:
        tapi[i + 1] = X[i]
    else:
        tapi[i + 1] = 0
print(m)
for t in tapi:
    print(t)
0