結果

問題 No.2482 Sandglasses
ユーザー misonikomipanmisonikomipan
提出日時 2023-09-23 20:13:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,294 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 56,624 KB
最終ジャッジ日時 2024-04-28 09:05:03
合計ジャッジ時間 34,436 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,624 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,624 KB
testcase_03 AC 1,204 ms
56,200 KB
testcase_04 AC 1,154 ms
56,072 KB
testcase_05 AC 1,145 ms
56,200 KB
testcase_06 AC 1,192 ms
56,280 KB
testcase_07 AC 1,161 ms
56,200 KB
testcase_08 AC 1,228 ms
56,072 KB
testcase_09 AC 1,294 ms
56,208 KB
testcase_10 AC 1,157 ms
56,204 KB
testcase_11 AC 1,216 ms
56,200 KB
testcase_12 AC 1,190 ms
56,204 KB
testcase_13 AC 1,276 ms
56,204 KB
testcase_14 AC 1,164 ms
56,328 KB
testcase_15 AC 1,208 ms
56,076 KB
testcase_16 AC 1,167 ms
56,200 KB
testcase_17 AC 1,225 ms
56,324 KB
testcase_18 AC 1,164 ms
56,288 KB
testcase_19 AC 1,202 ms
56,328 KB
testcase_20 AC 1,213 ms
56,328 KB
testcase_21 AC 1,135 ms
56,200 KB
testcase_22 AC 1,176 ms
56,068 KB
testcase_23 AC 1,174 ms
56,380 KB
testcase_24 AC 1,219 ms
56,516 KB
testcase_25 AC 1,247 ms
56,624 KB
testcase_26 AC 1,175 ms
56,380 KB
testcase_27 AC 1,172 ms
56,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(t):
    # 時刻0にBが上向き,Aは空っぽの状態で,t秒後のAの容量
    t %= 2 * K  # 周期2K
    if t <= K:
        return t
    else:
        return 2 * K - t


# アリのやつっぽい
N, K, T = map(int, input().split())
A = list(input().split())

B = list(map(int, input().split()))
BB = [[b, i] for i, b in enumerate(B)]
BB.sort()
C = [0] * N  # 答え
# 衝突を無視してT病後の位置を考える
for n in range(N):
    if A[n] == "A":
        C[n] = solve(T - B[n])
    else:
        C[n] = solve(T + B[n])
C.sort()
ans = [0] * N
for i in range(N):
    ans[BB[i][1]] = C[i]
print(*ans)
0