結果

問題 No.945 YKC饅頭
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-03 23:09:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,377 ms / 2,000 ms
コード長 624 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 136,644 KB
最終ジャッジ日時 2024-04-28 18:17:49
合計ジャッジ時間 23,020 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
54,120 KB
testcase_01 AC 39 ms
53,368 KB
testcase_02 AC 42 ms
54,172 KB
testcase_03 AC 55 ms
64,128 KB
testcase_04 AC 41 ms
54,504 KB
testcase_05 AC 44 ms
54,296 KB
testcase_06 AC 52 ms
62,804 KB
testcase_07 AC 48 ms
59,908 KB
testcase_08 AC 44 ms
54,040 KB
testcase_09 AC 43 ms
54,724 KB
testcase_10 AC 44 ms
54,380 KB
testcase_11 AC 43 ms
54,660 KB
testcase_12 AC 51 ms
61,656 KB
testcase_13 AC 51 ms
61,904 KB
testcase_14 AC 53 ms
63,088 KB
testcase_15 AC 41 ms
54,584 KB
testcase_16 AC 45 ms
60,648 KB
testcase_17 AC 46 ms
55,900 KB
testcase_18 AC 44 ms
55,252 KB
testcase_19 AC 40 ms
53,092 KB
testcase_20 AC 41 ms
54,128 KB
testcase_21 AC 41 ms
53,848 KB
testcase_22 AC 56 ms
64,288 KB
testcase_23 AC 60 ms
65,732 KB
testcase_24 AC 55 ms
65,032 KB
testcase_25 AC 50 ms
61,524 KB
testcase_26 AC 51 ms
63,408 KB
testcase_27 AC 41 ms
54,124 KB
testcase_28 AC 40 ms
52,928 KB
testcase_29 AC 40 ms
52,888 KB
testcase_30 AC 40 ms
52,656 KB
testcase_31 AC 135 ms
80,396 KB
testcase_32 AC 92 ms
81,420 KB
testcase_33 AC 238 ms
92,344 KB
testcase_34 AC 351 ms
109,208 KB
testcase_35 AC 1,166 ms
127,776 KB
testcase_36 AC 423 ms
117,476 KB
testcase_37 AC 358 ms
112,504 KB
testcase_38 AC 375 ms
107,676 KB
testcase_39 AC 196 ms
86,520 KB
testcase_40 AC 174 ms
86,780 KB
testcase_41 AC 112 ms
81,412 KB
testcase_42 AC 551 ms
121,684 KB
testcase_43 AC 355 ms
112,924 KB
testcase_44 AC 472 ms
116,324 KB
testcase_45 AC 463 ms
123,484 KB
testcase_46 AC 88 ms
79,196 KB
testcase_47 AC 381 ms
108,372 KB
testcase_48 AC 179 ms
83,528 KB
testcase_49 AC 297 ms
92,652 KB
testcase_50 AC 511 ms
129,312 KB
testcase_51 AC 1,127 ms
136,340 KB
testcase_52 AC 1,377 ms
136,644 KB
testcase_53 AC 792 ms
136,412 KB
testcase_54 AC 676 ms
136,472 KB
testcase_55 AC 1,361 ms
136,588 KB
testcase_56 AC 52 ms
66,788 KB
testcase_57 AC 52 ms
67,404 KB
testcase_58 AC 493 ms
105,500 KB
testcase_59 AC 574 ms
110,064 KB
testcase_60 AC 273 ms
94,268 KB
testcase_61 AC 507 ms
106,660 KB
testcase_62 AC 490 ms
105,856 KB
testcase_63 AC 66 ms
74,376 KB
testcase_64 AC 298 ms
95,468 KB
testcase_65 AC 249 ms
92,832 KB
testcase_66 AC 239 ms
92,180 KB
testcase_67 AC 365 ms
100,340 KB
testcase_68 AC 276 ms
94,604 KB
testcase_69 AC 152 ms
87,524 KB
testcase_70 AC 188 ms
89,244 KB
testcase_71 AC 184 ms
88,912 KB
testcase_72 AC 360 ms
97,828 KB
testcase_73 AC 636 ms
108,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import io, os
input = sys.stdin.readline

import heapq

n, m = map(int, input().split())

Q = [[] for i in range(n)]
for i in range(m):
    l, r, t = map(str, input().split())
    l, r = int(l), int(r)
    l, r = l-1, r-1
    if t == 'Y':
        c = 0
    elif t == 'K':
        c = 1
    else:
        c = 2
    Q[l].append((i, r, c))

ans = [0]*3
hq = []
heapq.heapify(hq)
for i in range(n):
    for j, r, c in Q[i]:
        heapq.heappush(hq, (j, r, c))
    while hq:
        j, r, c = hq[0]
        if i <= r:
            ans[c] += 1
            break
        else:
            heapq.heappop(hq)
print(*ans)
0