結果

問題 No.2482 Sandglasses
ユーザー KudeKude
提出日時 2023-09-22 21:41:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 397 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 139,580 KB
最終ジャッジ日時 2024-04-28 09:00:31
合計ジャッジ時間 12,933 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,224 KB
testcase_01 AC 41 ms
51,840 KB
testcase_02 AC 41 ms
52,096 KB
testcase_03 AC 391 ms
138,280 KB
testcase_04 AC 391 ms
139,044 KB
testcase_05 AC 370 ms
138,856 KB
testcase_06 AC 377 ms
138,916 KB
testcase_07 AC 376 ms
138,660 KB
testcase_08 AC 370 ms
138,660 KB
testcase_09 AC 380 ms
139,300 KB
testcase_10 AC 378 ms
138,916 KB
testcase_11 AC 375 ms
138,408 KB
testcase_12 AC 380 ms
138,664 KB
testcase_13 AC 372 ms
138,656 KB
testcase_14 AC 390 ms
139,308 KB
testcase_15 AC 383 ms
138,940 KB
testcase_16 AC 397 ms
138,664 KB
testcase_17 AC 377 ms
138,660 KB
testcase_18 AC 379 ms
139,360 KB
testcase_19 AC 363 ms
139,040 KB
testcase_20 AC 363 ms
138,924 KB
testcase_21 AC 388 ms
139,432 KB
testcase_22 AC 369 ms
138,408 KB
testcase_23 AC 347 ms
139,580 KB
testcase_24 AC 350 ms
139,512 KB
testcase_25 AC 353 ms
138,868 KB
testcase_26 AC 347 ms
139,000 KB
testcase_27 AC 356 ms
139,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
n, k, t = map(int, input().split())
a = input().split()
b = list(map(int, input().split()))
c = []
for ai, bi in zip(a, b):
    ci = bi - t if ai == 'A' else bi + t
    ci %= 2 * k
    if ci > k:
        ci = 2 * k - ci
    c.append(ci)
c.sort()
ans = []
b2 = sorted(b)
for x in b:
    ans.append(c[bisect_left(b2, x)])
print(*ans)
0