結果

問題 No.945 YKC饅頭
ユーザー rlangevinrlangevin
提出日時 2023-12-07 23:06:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,242 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 146,608 KB
最終ジャッジ日時 2023-12-07 23:07:16
合計ジャッジ時間 23,534 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 49 ms
63,772 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 42 ms
58,688 KB
testcase_06 AC 57 ms
63,528 KB
testcase_07 AC 49 ms
61,440 KB
testcase_08 AC 39 ms
53,460 KB
testcase_09 AC 42 ms
53,460 KB
testcase_10 AC 45 ms
60,796 KB
testcase_11 AC 44 ms
58,688 KB
testcase_12 AC 49 ms
61,444 KB
testcase_13 AC 48 ms
61,376 KB
testcase_14 AC 66 ms
63,512 KB
testcase_15 AC 38 ms
53,460 KB
testcase_16 AC 43 ms
59,200 KB
testcase_17 AC 41 ms
55,588 KB
testcase_18 AC 44 ms
60,796 KB
testcase_19 AC 40 ms
58,688 KB
testcase_20 AC 38 ms
53,460 KB
testcase_21 AC 37 ms
53,460 KB
testcase_22 AC 51 ms
63,772 KB
testcase_23 AC 56 ms
65,988 KB
testcase_24 AC 50 ms
63,772 KB
testcase_25 AC 46 ms
61,376 KB
testcase_26 AC 47 ms
63,648 KB
testcase_27 AC 39 ms
58,816 KB
testcase_28 AC 39 ms
58,816 KB
testcase_29 AC 35 ms
53,460 KB
testcase_30 AC 35 ms
53,460 KB
testcase_31 AC 124 ms
81,340 KB
testcase_32 AC 99 ms
86,744 KB
testcase_33 AC 247 ms
98,616 KB
testcase_34 AC 309 ms
111,932 KB
testcase_35 AC 1,005 ms
136,448 KB
testcase_36 AC 369 ms
115,688 KB
testcase_37 AC 314 ms
112,820 KB
testcase_38 AC 319 ms
110,164 KB
testcase_39 AC 199 ms
90,288 KB
testcase_40 AC 176 ms
93,784 KB
testcase_41 AC 112 ms
83,796 KB
testcase_42 AC 479 ms
124,492 KB
testcase_43 AC 343 ms
112,296 KB
testcase_44 AC 479 ms
121,772 KB
testcase_45 AC 461 ms
126,048 KB
testcase_46 AC 91 ms
82,412 KB
testcase_47 AC 367 ms
112,304 KB
testcase_48 AC 159 ms
84,008 KB
testcase_49 AC 273 ms
96,752 KB
testcase_50 AC 453 ms
132,552 KB
testcase_51 AC 1,038 ms
146,448 KB
testcase_52 AC 1,238 ms
146,608 KB
testcase_53 AC 755 ms
145,228 KB
testcase_54 AC 642 ms
146,160 KB
testcase_55 AC 1,242 ms
146,536 KB
testcase_56 AC 64 ms
76,936 KB
testcase_57 AC 58 ms
72,840 KB
testcase_58 AC 490 ms
111,816 KB
testcase_59 AC 544 ms
116,060 KB
testcase_60 AC 265 ms
100,348 KB
testcase_61 AC 515 ms
112,920 KB
testcase_62 AC 471 ms
112,420 KB
testcase_63 AC 66 ms
77,376 KB
testcase_64 AC 278 ms
101,892 KB
testcase_65 AC 265 ms
98,156 KB
testcase_66 AC 235 ms
98,400 KB
testcase_67 AC 337 ms
106,972 KB
testcase_68 AC 262 ms
100,152 KB
testcase_69 AC 142 ms
91,356 KB
testcase_70 AC 191 ms
93,916 KB
testcase_71 AC 193 ms
93,020 KB
testcase_72 AC 340 ms
104,180 KB
testcase_73 AC 615 ms
114,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from heapq import *

N, M = map(int, input().split())
ans = [-1] * N
C = {"Y":0, "K":1, "C":2}
YKC = ["Y", "K", "C"]
D = [[] for i in range(N)]
for i in range(M):
    L, R, T = input().split()
    L, R = int(L) - 1, int(R) - 1
    D[L].append((R, C[T], i))
    
H = []
for i in range(N):
    for r, c, ind in D[i]:
        heappush(H, (ind, r, c))
    while H:
        if H[0][1] >= i:
            ans[i] = YKC[H[0][2]]
            break
        else:
            heappop(H)
            
print(ans.count("Y"), ans.count("K"), ans.count("C"))
0