その他AppleScriptでPython3 command not foundが出る brew install python3した後に、AppleScriptで以下のようなコマンドを書いた。 do shell script "python3 hoge/fuga.sh" しかし、com...2020.03.31その他
AtCoderAtCoder Beginner Contest 160の感想 ABC160に参加した。 A - Coffee そのまま実装。 s = input() if s == s and s == s: print('Yes') else: ...2020.03.282020.04.14AtCoder
AtCoderAtCoder Beginner Contest 159の感想 ABC159に参加した。 A - The Number of Even Pairs 偶数+偶数か、奇数+奇数の2通り。 n, m = map(int, input().split()) ans = n * (n...2020.03.222020.04.14AtCoder
AtCoderAtCoder Beginner Contest 158の感想 ABC158に参加した。 A - Station and Bus Aのみ又はBのみの場合はNoになる。 s = input() if len(list(set(s))) == 1: print('...2020.03.082020.04.14AtCoder
PythonPythonで幅優先探索と深さ優先探索の実装と使い分け 木構造や迷路の探索を行う際、幅優先探索と深さ優先探索を使うことがある。 以下のようなシンプルな木構造を与えられた時、各ノードを探索していくというようなシンプルな実装を考える。 図はこちらのサイトで作成。...2020.03.062021.05.30Python
PythonPythonで逆元を使ってnCr mod 1000000007を計算 AtCoderを始めてから、1000000007で割ったあまりを求めよ、という問題を見る機会があった。 直近だとAtCoder Beginner Contest 156のD問題 Bouquet。 足し算、引き算...2020.03.03Python