結果

問題 No.909 たぴの配置
コンテスト
ユーザー brthyyjp
提出日時 2020-04-22 15:31:24
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 124 ms / 3,000 ms
コード長 529 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 133 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 123,008 KB
最終ジャッジ日時 2026-04-27 14:08:51
合計ジャッジ時間 3,351 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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