結果

問題 No.909 たぴの配置
ユーザー brthyyjpbrthyyjp
提出日時 2020-04-22 15:31:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 3,000 ms
コード長 529 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 109,316 KB
最終ジャッジ日時 2024-04-19 15:02:23
合計ジャッジ時間 4,086 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,964 KB
testcase_01 AC 33 ms
52,312 KB
testcase_02 AC 33 ms
52,156 KB
testcase_03 AC 36 ms
52,192 KB
testcase_04 AC 37 ms
53,540 KB
testcase_05 AC 136 ms
108,876 KB
testcase_06 AC 136 ms
109,316 KB
testcase_07 AC 126 ms
105,364 KB
testcase_08 AC 153 ms
109,276 KB
testcase_09 AC 155 ms
109,192 KB
testcase_10 AC 144 ms
106,120 KB
testcase_11 AC 141 ms
105,280 KB
testcase_12 AC 126 ms
108,420 KB
testcase_13 AC 129 ms
108,868 KB
testcase_14 AC 134 ms
105,364 KB
testcase_15 AC 138 ms
105,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 10**18
id = -1
for i in range(n):
    x = X[i]
    y = Y[i]
    if ans >= x+y:
        xm, ym = x, y
        ans = x+y

print(ans)
print(0)
for i in range(n):
    x = X[i]
    y = Y[i]
    if x >= ans and y >= ans:
        print(ans)
    elif x >= ans and y < ans:
        print(ans)
    elif x < ans and y >= ans:
        print(0)
    else:
        if x <= xm:
            print(x)
        else:
            print(ans-y)
print(ans)
0