結果

問題 No.945 YKC饅頭
ユーザー mkawa2mkawa2
提出日時 2019-12-12 09:43:07
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 1,570 ms / 2,000 ms
コード長 810 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 76,920 KB
最終ジャッジ日時 2023-09-07 00:53:38
合計ジャッジ時間 28,385 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,648 KB
testcase_01 AC 21 ms
8,736 KB
testcase_02 AC 19 ms
8,672 KB
testcase_03 AC 23 ms
8,804 KB
testcase_04 AC 19 ms
8,704 KB
testcase_05 AC 20 ms
8,904 KB
testcase_06 AC 22 ms
8,960 KB
testcase_07 AC 20 ms
8,836 KB
testcase_08 AC 20 ms
8,712 KB
testcase_09 AC 20 ms
8,764 KB
testcase_10 AC 21 ms
8,816 KB
testcase_11 AC 20 ms
8,792 KB
testcase_12 AC 20 ms
8,836 KB
testcase_13 AC 22 ms
8,868 KB
testcase_14 AC 23 ms
8,904 KB
testcase_15 AC 20 ms
8,740 KB
testcase_16 AC 20 ms
8,648 KB
testcase_17 AC 22 ms
8,772 KB
testcase_18 AC 21 ms
8,900 KB
testcase_19 AC 20 ms
8,900 KB
testcase_20 AC 20 ms
8,756 KB
testcase_21 AC 20 ms
8,680 KB
testcase_22 AC 23 ms
8,916 KB
testcase_23 AC 23 ms
8,912 KB
testcase_24 AC 23 ms
9,024 KB
testcase_25 AC 23 ms
8,920 KB
testcase_26 AC 24 ms
8,916 KB
testcase_27 AC 19 ms
8,860 KB
testcase_28 AC 20 ms
8,708 KB
testcase_29 AC 19 ms
8,740 KB
testcase_30 AC 19 ms
8,736 KB
testcase_31 AC 70 ms
14,704 KB
testcase_32 AC 90 ms
25,556 KB
testcase_33 AC 263 ms
33,816 KB
testcase_34 AC 526 ms
44,088 KB
testcase_35 AC 1,214 ms
70,528 KB
testcase_36 AC 680 ms
39,076 KB
testcase_37 AC 607 ms
36,484 KB
testcase_38 AC 565 ms
36,396 KB
testcase_39 AC 178 ms
28,700 KB
testcase_40 AC 174 ms
30,912 KB
testcase_41 AC 99 ms
25,560 KB
testcase_42 AC 801 ms
53,460 KB
testcase_43 AC 592 ms
35,452 KB
testcase_44 AC 728 ms
50,936 KB
testcase_45 AC 843 ms
50,904 KB
testcase_46 AC 59 ms
17,776 KB
testcase_47 AC 547 ms
43,660 KB
testcase_48 AC 131 ms
15,280 KB
testcase_49 AC 283 ms
32,148 KB
testcase_50 AC 926 ms
53,680 KB
testcase_51 AC 1,415 ms
76,820 KB
testcase_52 AC 1,570 ms
76,828 KB
testcase_53 AC 1,219 ms
76,920 KB
testcase_54 AC 1,146 ms
76,692 KB
testcase_55 AC 1,566 ms
76,912 KB
testcase_56 AC 135 ms
40,312 KB
testcase_57 AC 122 ms
40,360 KB
testcase_58 AC 705 ms
64,292 KB
testcase_59 AC 848 ms
69,884 KB
testcase_60 AC 346 ms
50,672 KB
testcase_61 AC 748 ms
66,100 KB
testcase_62 AC 721 ms
64,868 KB
testcase_63 AC 125 ms
40,724 KB
testcase_64 AC 369 ms
51,668 KB
testcase_65 AC 309 ms
49,276 KB
testcase_66 AC 293 ms
48,632 KB
testcase_67 AC 550 ms
58,172 KB
testcase_68 AC 353 ms
50,976 KB
testcase_69 AC 189 ms
43,636 KB
testcase_70 AC 210 ms
44,476 KB
testcase_71 AC 211 ms
44,724 KB
testcase_72 AC 459 ms
54,596 KB
testcase_73 AC 807 ms
68,144 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