結果

問題 No.2482 Sandglasses
ユーザー KeroruKeroru
提出日時 2023-09-22 22:28:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 534 ms / 2,000 ms
コード長 276 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 158,392 KB
最終ジャッジ日時 2024-11-16 22:50:24
合計ジャッジ時間 15,890 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k,t=map(int,input().split())
c=input().split()
a=[*map(int,input().split())]
b=[]
for u,x in zip(c,a):
    s=2*k
    z=[x+t,x-t]['B'>u]%s
    if z>k:z=s-z
    b+=z,
p=sorted(enumerate(a),key=lambda x:x[1])
b=sorted(b)
z=[0]*n
for i in range(n):
    z[p[i][0]]=b[i]
print(*z)
0