Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ABC451/mshuun/A_illegal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Yes"if len(input())%5==0 else"No")
9 changes: 9 additions & 0 deletions ABC451/mshuun/B_Personnel_Change.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
N, M = map(int, input().split())
A = [0] * M

for _ in range(N):
a, b = map(int, input().split())
A[a-1] -= 1
A[b-1] += 1

print(*A, sep="\n")
12 changes: 12 additions & 0 deletions ABC451/mshuun/C_Understory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys
from heapq import *
input = sys.stdin.readline
T = []
for _ in range(int(input())):
c, h = map(int, input().split())
if c == 1:
heappush(T, h)
else:
while T and T[0] <= h:
heappop(T)
print(len(T))
17 changes: 17 additions & 0 deletions ABC451/mshuun/D_Concat_Power_of_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
N = int(input())
ns = [set() for _ in range(10)]

for i in range(30):
n = 2**i
ns[len(str(n))].add(n)

for tar in range(2, 10):
for cur in range(1, tar // 2 + 1):
for a in ns[cur]:
for b in ns[tar - cur]:
ns[tar].add(int(str(a) + str(b)))
ns[tar].add(int(str(b) + str(a)))


ans = sorted(set().union(*ns))
print(ans[N - 1])