結果

問題 No.2482 Sandglasses
ユーザー とりゐとりゐ
提出日時 2023-09-22 21:34:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 766 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 144,888 KB
最終ジャッジ日時 2024-04-28 09:00:22
合計ジャッジ時間 22,298 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 41 ms
52,096 KB
testcase_02 AC 41 ms
51,840 KB
testcase_03 AC 736 ms
143,612 KB
testcase_04 AC 750 ms
144,252 KB
testcase_05 AC 744 ms
144,500 KB
testcase_06 AC 754 ms
144,312 KB
testcase_07 AC 733 ms
143,608 KB
testcase_08 AC 724 ms
143,920 KB
testcase_09 AC 726 ms
144,324 KB
testcase_10 AC 733 ms
144,380 KB
testcase_11 AC 714 ms
143,536 KB
testcase_12 AC 724 ms
143,864 KB
testcase_13 AC 728 ms
144,632 KB
testcase_14 AC 731 ms
144,560 KB
testcase_15 AC 734 ms
143,736 KB
testcase_16 AC 766 ms
143,868 KB
testcase_17 AC 725 ms
144,248 KB
testcase_18 AC 723 ms
144,888 KB
testcase_19 AC 723 ms
144,000 KB
testcase_20 AC 739 ms
144,440 KB
testcase_21 AC 737 ms
144,320 KB
testcase_22 AC 738 ms
144,048 KB
testcase_23 AC 733 ms
143,800 KB
testcase_24 AC 738 ms
144,064 KB
testcase_25 AC 724 ms
143,676 KB
testcase_26 AC 711 ms
144,516 KB
testcase_27 AC 721 ms
144,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k,t=map(int,input().split())
a=list(input().split())
b=list(map(int,input().split()))

c=[(b[i],i) for i in range(n)]
c.sort()

d=[]
for i in range(n):
  if a[i]=='B':
    x=b[i]+t
  else:
    x=b[i]-t
  x%=2*k
  if x>=k:
    x=2*k-x
  d.append(x)
  
d.sort()
p=[0]*n
for i in range(n):
  p[c[i][1]]=i

ans=[]
for i in range(n):
  ans.append(d[p[i]])

print(*ans)
0