diff --git a/ABC451/mshuun/A_illegal.py b/ABC451/mshuun/A_illegal.py new file mode 100644 index 0000000..988fc29 --- /dev/null +++ b/ABC451/mshuun/A_illegal.py @@ -0,0 +1 @@ +print("Yes"if len(input())%5==0 else"No") \ No newline at end of file diff --git a/ABC451/mshuun/B_Personnel_Change.py b/ABC451/mshuun/B_Personnel_Change.py new file mode 100644 index 0000000..8b5d693 --- /dev/null +++ b/ABC451/mshuun/B_Personnel_Change.py @@ -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") \ No newline at end of file diff --git a/ABC451/mshuun/C_Understory.py b/ABC451/mshuun/C_Understory.py new file mode 100644 index 0000000..bafe28c --- /dev/null +++ b/ABC451/mshuun/C_Understory.py @@ -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)) diff --git a/ABC451/mshuun/D_Concat_Power_of_2.py b/ABC451/mshuun/D_Concat_Power_of_2.py new file mode 100644 index 0000000..20c8810 --- /dev/null +++ b/ABC451/mshuun/D_Concat_Power_of_2.py @@ -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]) \ No newline at end of file