結果

問題 No.945 YKC饅頭
ユーザー mkawa2mkawa2
提出日時 2019-12-12 09:44:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,248 ms / 2,000 ms
コード長 810 bytes
コンパイル時間 675 ms
コンパイル使用メモリ 86,636 KB
実行使用メモリ 140,896 KB
最終ジャッジ日時 2023-09-07 00:55:00
合計ジャッジ時間 26,960 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
71,668 KB
testcase_01 AC 85 ms
71,488 KB
testcase_02 AC 95 ms
72,004 KB
testcase_03 AC 114 ms
76,764 KB
testcase_04 AC 88 ms
71,480 KB
testcase_05 AC 93 ms
72,184 KB
testcase_06 AC 104 ms
76,404 KB
testcase_07 AC 100 ms
76,332 KB
testcase_08 AC 91 ms
71,704 KB
testcase_09 AC 97 ms
72,312 KB
testcase_10 AC 98 ms
72,184 KB
testcase_11 AC 97 ms
72,272 KB
testcase_12 AC 104 ms
76,612 KB
testcase_13 AC 105 ms
76,260 KB
testcase_14 AC 107 ms
76,440 KB
testcase_15 AC 96 ms
72,304 KB
testcase_16 AC 97 ms
76,340 KB
testcase_17 AC 109 ms
76,372 KB
testcase_18 AC 98 ms
72,360 KB
testcase_19 AC 89 ms
71,656 KB
testcase_20 AC 94 ms
71,964 KB
testcase_21 AC 94 ms
72,232 KB
testcase_22 AC 112 ms
76,752 KB
testcase_23 AC 116 ms
77,128 KB
testcase_24 AC 114 ms
76,744 KB
testcase_25 AC 113 ms
76,440 KB
testcase_26 AC 108 ms
77,028 KB
testcase_27 AC 88 ms
71,692 KB
testcase_28 AC 88 ms
71,448 KB
testcase_29 AC 86 ms
71,740 KB
testcase_30 AC 88 ms
71,724 KB
testcase_31 AC 202 ms
86,400 KB
testcase_32 AC 177 ms
100,920 KB
testcase_33 AC 305 ms
102,484 KB
testcase_34 AC 392 ms
106,952 KB
testcase_35 AC 1,055 ms
131,932 KB
testcase_36 AC 465 ms
103,556 KB
testcase_37 AC 422 ms
101,732 KB
testcase_38 AC 439 ms
101,656 KB
testcase_39 AC 268 ms
96,128 KB
testcase_40 AC 245 ms
99,776 KB
testcase_41 AC 176 ms
91,252 KB
testcase_42 AC 576 ms
115,264 KB
testcase_43 AC 407 ms
100,860 KB
testcase_44 AC 527 ms
117,240 KB
testcase_45 AC 538 ms
114,268 KB
testcase_46 AC 154 ms
91,256 KB
testcase_47 AC 441 ms
108,432 KB
testcase_48 AC 236 ms
84,000 KB
testcase_49 AC 351 ms
99,588 KB
testcase_50 AC 561 ms
119,728 KB
testcase_51 AC 1,063 ms
136,684 KB
testcase_52 AC 1,238 ms
138,560 KB
testcase_53 AC 840 ms
136,520 KB
testcase_54 AC 724 ms
140,896 KB
testcase_55 AC 1,248 ms
138,400 KB
testcase_56 AC 131 ms
108,848 KB
testcase_57 AC 128 ms
108,480 KB
testcase_58 AC 590 ms
126,852 KB
testcase_59 AC 685 ms
128,832 KB
testcase_60 AC 366 ms
112,120 KB
testcase_61 AC 620 ms
128,136 KB
testcase_62 AC 589 ms
126,972 KB
testcase_63 AC 152 ms
109,292 KB
testcase_64 AC 380 ms
110,544 KB
testcase_65 AC 331 ms
110,356 KB
testcase_66 AC 363 ms
108,784 KB
testcase_67 AC 456 ms
118,276 KB
testcase_68 AC 371 ms
108,368 KB
testcase_69 AC 242 ms
109,912 KB
testcase_70 AC 248 ms
109,544 KB
testcase_71 AC 266 ms
106,368 KB
testcase_72 AC 439 ms
114,532 KB
testcase_73 AC 664 ms
128,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *
from collections import defaultdict
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n, m = MI()
    to = defaultdict(list)
    ttomark = {"Y": 0, "K": 1, "C": 2}
    for p in range(m):
        l, r, t = input().split()
        l, r = int(l) - 1, int(r) - 1
        to[l].append([p, r, ttomark[t]])
    hp = []
    ans = [0] * 3
    for i in range(n):
        for prm in to[i]:
            heappush(hp, prm)
        while hp and hp[0][1] < i: heappop(hp)
        if not hp:continue
        ans[hp[0][2]] += 1
    print(*ans)

main()
0