結果
問題 | No.945 YKC饅頭 |
ユーザー | mkawa2 |
提出日時 | 2021-03-18 16:27:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 345 ms / 2,000 ms |
コード長 | 1,408 bytes |
コンパイル時間 | 214 ms |
コンパイル使用メモリ | 82,312 KB |
実行使用メモリ | 92,036 KB |
最終ジャッジ日時 | 2024-11-16 19:35:47 |
合計ジャッジ時間 | 13,209 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
52,480 KB |
testcase_01 | AC | 42 ms
52,352 KB |
testcase_02 | AC | 48 ms
59,520 KB |
testcase_03 | AC | 66 ms
68,352 KB |
testcase_04 | AC | 43 ms
58,624 KB |
testcase_05 | AC | 49 ms
61,056 KB |
testcase_06 | AC | 62 ms
66,944 KB |
testcase_07 | AC | 62 ms
66,304 KB |
testcase_08 | AC | 46 ms
59,008 KB |
testcase_09 | AC | 55 ms
65,152 KB |
testcase_10 | AC | 63 ms
67,968 KB |
testcase_11 | AC | 55 ms
64,512 KB |
testcase_12 | AC | 55 ms
64,512 KB |
testcase_13 | AC | 61 ms
67,968 KB |
testcase_14 | AC | 65 ms
68,736 KB |
testcase_15 | AC | 41 ms
52,992 KB |
testcase_16 | AC | 48 ms
60,416 KB |
testcase_17 | AC | 55 ms
63,872 KB |
testcase_18 | AC | 60 ms
66,816 KB |
testcase_19 | AC | 44 ms
58,368 KB |
testcase_20 | AC | 46 ms
59,520 KB |
testcase_21 | AC | 45 ms
59,264 KB |
testcase_22 | AC | 62 ms
67,584 KB |
testcase_23 | AC | 69 ms
68,224 KB |
testcase_24 | AC | 71 ms
68,480 KB |
testcase_25 | AC | 69 ms
68,352 KB |
testcase_26 | AC | 71 ms
68,480 KB |
testcase_27 | AC | 47 ms
59,008 KB |
testcase_28 | AC | 47 ms
59,008 KB |
testcase_29 | AC | 39 ms
51,840 KB |
testcase_30 | AC | 39 ms
51,840 KB |
testcase_31 | AC | 83 ms
77,824 KB |
testcase_32 | AC | 77 ms
73,600 KB |
testcase_33 | AC | 107 ms
81,664 KB |
testcase_34 | AC | 133 ms
83,328 KB |
testcase_35 | AC | 171 ms
89,296 KB |
testcase_36 | AC | 149 ms
84,480 KB |
testcase_37 | AC | 144 ms
82,176 KB |
testcase_38 | AC | 138 ms
81,664 KB |
testcase_39 | AC | 97 ms
78,720 KB |
testcase_40 | AC | 96 ms
81,664 KB |
testcase_41 | AC | 86 ms
79,104 KB |
testcase_42 | AC | 170 ms
86,912 KB |
testcase_43 | AC | 144 ms
83,072 KB |
testcase_44 | AC | 149 ms
85,192 KB |
testcase_45 | AC | 169 ms
90,368 KB |
testcase_46 | AC | 72 ms
71,296 KB |
testcase_47 | AC | 134 ms
83,968 KB |
testcase_48 | AC | 93 ms
76,800 KB |
testcase_49 | AC | 105 ms
79,360 KB |
testcase_50 | AC | 179 ms
90,496 KB |
testcase_51 | AC | 176 ms
91,024 KB |
testcase_52 | AC | 194 ms
91,592 KB |
testcase_53 | AC | 172 ms
90,824 KB |
testcase_54 | AC | 193 ms
91,592 KB |
testcase_55 | AC | 190 ms
92,036 KB |
testcase_56 | AC | 60 ms
66,304 KB |
testcase_57 | AC | 57 ms
66,432 KB |
testcase_58 | AC | 295 ms
89,612 KB |
testcase_59 | AC | 345 ms
90,620 KB |
testcase_60 | AC | 184 ms
82,816 KB |
testcase_61 | AC | 311 ms
88,948 KB |
testcase_62 | AC | 297 ms
89,348 KB |
testcase_63 | AC | 87 ms
81,664 KB |
testcase_64 | AC | 192 ms
83,580 KB |
testcase_65 | AC | 169 ms
82,680 KB |
testcase_66 | AC | 172 ms
82,420 KB |
testcase_67 | AC | 260 ms
86,152 KB |
testcase_68 | AC | 183 ms
83,700 KB |
testcase_69 | AC | 117 ms
81,536 KB |
testcase_70 | AC | 128 ms
81,664 KB |
testcase_71 | AC | 127 ms
81,664 KB |
testcase_72 | AC | 212 ms
84,716 KB |
testcase_73 | AC | 322 ms
90,492 KB |
ソースコード
import sys sys.setrecursionlimit(10**6) int1 = lambda x: int(x)-1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.buffer.readline()) def LI(): return list(map(int, sys.stdin.buffer.readline().split())) def LI1(): return list(map(int1, sys.stdin.buffer.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def BI(): return sys.stdin.buffer.readline().rstrip() def SI(): return sys.stdin.buffer.readline().rstrip().decode() # dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = 10**16 md = 998244353 # md = 10**9+7 n, m = LI() w = 1 << (n-1).bit_length() tree = [inf]*w*2 tt = [] for i in range(m): l, r, t = SI().split() l, r = int(l)-1, int(r) t = "YKC".index(t) tt.append(t) stack = [(1, 0, w)] while stack: u, ul, ur = stack.pop() if ur <= l or r <= ul: continue if tree[u] != inf: continue if l <= ul and ur <= r: tree[u] = i else: um = (ul+ur)//2 stack.append((u*2, ul, um)) stack.append((u*2+1, um, ur)) # print(i,l,r,stack,tree) for u in range(2, w+n): tree[u] = min(tree[u], tree[u//2]) cnt = [0]*3 for k in range(n): i = tree[k+w] if i != inf: cnt[tt[i]] += 1 print(*cnt)