2022-01-01から1ヶ月間の記事一覧
こちらをまとめる。 細菌 分類(酸素に対する要求性と耐性 通性嫌気性 酸素あってもなくても 微好気性 低濃度の酸素が欲しいor高濃度の二酸化炭素 酸素ないとしんどい 偏性嫌気性 好気性代謝できない 耐性はいろいろ 絶対 0.5% 中等度 2~8% 耐気性嫌気性菌 …
Day 17. There are 3 types of solutions. 1st code is below. #1st solution n, M = map(int,input().split()) lr = for i in range(M): l,r = map(int,input().split()) lr.append((l,r)) answer = 0 for i in range(M-1): a, b = lr[i] for j in range(i+…
41人来ました、5人の部屋を5つ、4人の部屋を4つ、作ります。 1回目に5人の部屋にいました。 2回目にどこかの部屋に行くとき、さっき会った人と会う確率がいくつか気になる。 def c5(n): return n*(n-1)*(n-2)*(n-3)*(n-4)/(120) def c4(n): return n*(n-1)*(…
Day 16. code is below. N = int(input()) a,b,c = map(int,input().split()) answer = 10**5 for x in range(10000): if a*x>N: break for y in range(10000): if a*x+b*y>N: break z = (N-a*x-b*y) if z%c ==0: answer = min(answer, x+y+z//c) print(answ…
class German: def __init__(self): self.subject = ["Ich","Sie","Wir"] self.category = ["language","drink","academics","sports"] self.verb = ["lernen","trinken","studieren","spieren"] self.sentence = [] self.flag = -1 def S(self,s): if s in …
ドイツ語を話せるようになりたい。 そのために勉強する こちらの東京外国語大学言語モジュールというサイトが、言語学習において、役に立つ模様。 今回はこれを利用して学習する。 始めましょうか。 Lesson 1 Step 1 現在人称変化 人称変化 主語に応じて動詞…
こちらの文献を大急ぎでまとめる。 Abstract ブラックホール駆動の外への流れが矮小銀河で見られることがある。 熱やガス放出とのかかわり 「矮小銀河でブラックホール駆動の外流が、どれほど、星の形成に影響するかが不明だった。」 どうして。巨大銀河の人…
こちらのサイトを知りたい Magst du Kohlrabi? - Nein, ich mag keinen Kohlrabi. コールラビは好きですか、いいえ好きではない。 ちなみに、Kohlrabiとは、カブのような野菜。こちら。 mögen modal verb 助動詞に属する 他の動詞とは違って、不定詞の二つ目…
こちらの本をおおざっぱにまとめる。 始めましょうか 基本概念 集合 数直線 直線上の点がただ一つの実数が対応する 実数の基本性質 4つの性質 四則演算 加減乗除 大小関係 3つの関係 大きいか小さいか等しい 稠密性 二つの異なるものの間に、実数があり 中点…
Day 15. This problem requires the way of thinking. 1st, we should fix how long distance we keep. 2nd, we should fix how many balls we put in the array. As for 2nd point, we can deny the unrealistic case by if sentence and some checking pro…
Day 14. So easy problem. As you know, Greedy Strategy is versatile in everyday life. This problem is just one example. Code is below. N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) A.sort() B.sort(…
Day 13. I come up with what I should do to solve this (namely, double dijkstra), but I didn't because i forgot how to use heapq module. So I learn heapq first, then after finishing it, I solve the problem. Code (for studying heapq) is belo…
To be editted.
I want to know various field of mathematical concept in order to make new perspective on medicine. こちらをまとめる。 最大次数の係数が1で、他が整数係数のある多項式の根で、その根がその多項式よりも次数の低い式を満足しないとき、その根は、「次…
こちらの話をまとめる。 貝殻のコレクション 表現型の多様性 大きさ、形、色、などの見た目 味 普遍性 貝殻は炭酸カルシウムが結晶化したもの 炭酸カルシウムは、貝の外套膜が分泌する液体に含まれる 作り方は工法が同じような感じ どのように同じ? ーそれ…
Day 12. We need the knowlegde of Union Find Tree. Code is below. H,W = map(int,input().split()) Q = int(input()) class UnionFindTree: def __init__(self,H,W): self.data = [0] * (H*W) self.parent = [i for i in range(H*W)] self.rank = [0] * (…
Day 11. This problem is interesting because its idea is really useful in our daily lives. When applying its idea, what matters most is how to calculate score of each task and how to estimate the time we will spend on it. Code is below. N =…
こちらの文献をまとめる。 連珠のルール Free Renju Rule プレイヤーは仮の黒、仮の白としてプレイする。仮の黒、の人は、真ん中に石を置く。 仮の白、の人は、黒石に隣接した位置に石を置く。 仮の黒、の人は、真ん中の5×5格子、の空き場所に石を置く。 仮…
Day 10. It is easy game, because it is just cumulative sumation of array until i th element. Now I know how much pre-processing is important when we want to decrease calculation cost. Code is below. #day 10 N = int(input()) sum_score = [[0…
Day 9. This problem wa hard for me. There are 2 reasons. First, I did not come up with the idea that integrates binary search to this problem. Second, I stick to perpendicular line. But now I get to the point. Code is below. N = int(input(…
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…
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+…
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(…
高速フーリエ変換という単語に遭遇したので、軽くまとめて、その上でお絵描きする。 はじめましょうか。 こちらのサイトをまとめる。 多項式乗算問題 入力が多項式2つ。(係数の配列2つ、長さm,n) 出力が、f(x)g(x)。長さm+n-1 1次式(係数は2つ)を2つかけ…
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 …
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 =…
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…
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全探索を…
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…
Old Maid(ババ抜き)にて、最初に何枚の状態になることが多いのか、ということが気になった。 それをシミュレーションする。 4人でプレイしていることを想定する。 何枚残るのか、ということを10000000回して、ヒストグラムにする。 import random def Mine…