プログラミング

貝殻と円錐

こちらの話をまとめる。 貝殻のコレクション 表現型の多様性 大きさ、形、色、などの見た目 味 普遍性 貝殻は炭酸カルシウムが結晶化したもの 炭酸カルシウムは、貝の外套膜が分泌する液体に含まれる 作り方は工法が同じような感じ どのように同じ? ーそれ…

Competitive Programing Typical 90 Problem day8

Day 8. This problem requires knowledge of dynamic programming. This type of DP is called Ear DP because its algorithm appeared in the problem whose name is "Ears". Ear DP requires current position and situation. (situation is sometimes n l…

Competitive Programing Typical 90 Problem day7

Day 7. This problem is easy game, because i grasp the meaning of binary search. Code is below. N = int(input()) A = list(map(int,input().split())) Q = int(input()) #input zone A.sort() def Complaint(b): l = 0 r = N while r-l > 1: mid = (r+…

Competitive Programing Typical 90 Problem day6

Day 6. I somehow grew up the ability to understand what I am writing. I want to keep going. Today's problem was interesting although it can be solved by simple strategy (greedy). Code is below. N, K = map(int,input().split()) S = list(str(…

Competitive Programing Typical 90 Problem day5

Day 5. It is a really hard problem for me, but I manage to write codes and grasp the meaning of them. There are 3 answers. Each of them has own perspective. 1st one is Digit DP, 2nd one is matrix exponentiation, last one is Doubling. Code …

Competitive Programing Typical 90 Problem day4

Day4. I think my barriers of programming are gone, if I keep this training for 90 days. Let's try 4th Problem. This one is easy one. Code is below. H, W = map(int,input().split()) #入力を受け取る Map = #地図を入れるもの、かご preprocess1 =…

Competitive Programing Typical 90 Problem day3

Day3. I want to go behind the outward form of inner meaning of each problem. Code is below. N = int(input()) graph = [[] for i in range(N)] #グラフを格納するもとを作る for i in range(N-1): a,b = map(int,input().split()) graph[a-1].append(b…

Competitive Programing Typical 90 Problem day2

2nd day. Today's theme is Brute Force Search by using bit transformation. Bit transformation is useful when we want to express all subsets of set. Code is below. 全探索が有効打になるのは、そもそもの有り得る解の数が少ないとき。 Bit全探索を…

Competitive Programing Typical 90 Problem day1

I decided to solve 1 problem 1 day to acquire programming skill. Binary Search N, L = map(int, input().split()) K = int(input()) A = list(map(int, input().split())) + [L] def greedy_cut_try(x, threshold): temp = 0 now_cut_num = 0 end_point…