AtCoder 修行日記#47
47日目
ABCのB問題を実施中。
勉強用のコンテンツはここから。
https://kenkoooo.com/atcoder/#/table/
進捗と一言感想
[B問題] 1問(残り8問)
ABC023:手芸王
冗長な気もしましたが、何とかできました。
文字列の処理は慣れてきた感があります。(残っている問題の領域や座標はまだ苦手…)
n = int(input()) s = input() acs = "b" count = 0 if len(s)%2==0 : print(-1) else : while(True): if len(s) <= len(acs) and s != acs : print(-1) break if count%3 == 1: acs = "a" + acs + "c" elif count%3 == 2: acs = "c" + acs + "a" else : if len(acs) > 1: acs = "b" + acs + "b" if s == acs : print(count) break count += 1
[C問題] 1問(残り156問)
ABC170: Forbidden List
出題分の求める「整数」の範囲を勘違いしていた感じ…全部数字が埋められていたら、101が近くなることがわかっていませんでした…。
テストをするなら思いつくべきでした、反省…。
x, n = map(int, input().split()) if n == 0: print(x) else : pn = [int(num) for num in input().split()] answers = {} for i in range(0,101): if not i in pn: answers[i] = abs(i-x) print(min(answers, key=answers.get))
参考
https://kenkoooo.com/atcoder/#/user/dandan611?userPageTab=AtCoder+Pie+Charts
Aizu Online Judge
www.youtube.com
目標
- まず、今年中に茶色コーダー
学習方針
- 参考:レッドコーダーが教える、競プロ・AtCoder上達のガイドライン【初級編:競プロを始めよう】 - Qiita
- 一日一題。(C問題までは!)
- コンテストにもなるべく参加する
- ちなみに言語はpython。
- つまったら10分くらいで解説動画見る
以上。