This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/dp/tasks/dp_k | |
[解説] | |
https://blog.hamayanhamayan.com/entry/2019/01/09/002200 | |
dp[k] := k個の石からなる山で先手が勝ち状態か(=1なら勝ち状態) | |
後退解析の基本は「遷移先がすべて勝ち状態なら負け状態。遷移先に1つでも負け状態があれば勝ち状態」である。 | |
あるdp[k]について、遷移先は100通りあるので、このすべてを見て、負け状態が1つでもあれば勝ち状態にする。 | |
注意すべきなのは、遷移することができない(遷移先が無い)場合は、操作を行えないということなので負け状態とすること。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc141/tasks/abc141_d | |
[解説] | |
https://youtu.be/fHZhDUzhzN0?t=1341 | |
割引券を何枚割り当てるか? | |
という考えではなく、1枚づつ最大の値段の商品に使っていけば、おのずと答えは出る。 | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc212/tasks/abc212_d | |
[解説] | |
https://blog.hamayanhamayan.com/entry/2021/08/01/012059 | |
[参考] | |
【Python】優先度付きキューの使い方【heapq】【ABC141 D】 | |
https://qiita.com/ell/items/fe52a9eb9499b7060ed6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc212/tasks/abc212_c | |
[結果] | |
PyPy3(7.3.0) AC 243ms | |
Python(3.8.2) AC 423ms | |
''' | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc166/tasks/abc166_d | |
[参考] | |
https://blog.hamayanhamayan.com/entry/2020/05/03/224316 | |
ここのコードをPythonコンバートしてみたもの。 | |
5乗の結果をキャッシュしてるから早いかと思ったら、普通に計算したのと変わらない。 | |
[結果] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc166/tasks/abc166_d | |
[解説] | |
https://blog.hamayanhamayan.com/entry/2020/05/03/224316 | |
https://img.atcoder.jp/abc166/editorial.pdf | |
https://youtu.be/OCRLlMa7kL0?t=4226 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc167/tasks/abc167_d | |
[解説] | |
https://blog.hamayanhamayan.com/entry/2020/05/10/232914 | |
dpでダブリングを用いるのが想定解答のようだが、周期性を用いたコードで何とか解けた。 | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc168/tasks/abc168_d | |
[解説] | |
https://img.atcoder.jp/abc168/editorial.pdf | |
https://blog.hamayanhamayan.com/entry/2020/05/17/224335 | |
" | |
競プロの考察方針の一つとして、典型問題に似ていないかという糸口がある。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc211/tasks/abc211_d | |
[解説] | |
公式 | |
https://atcoder.jp/contests/abc211/editorial/2003 | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
[問題] | |
https://atcoder.jp/contests/abc211/tasks/abc211_c | |
[解説] | |
AtCoder Beginner Contest 211 C問題 解説 | |
https://www.youtube.com/watch?v=Zu9S_kJ-7tk | |
snukeさん | |
dpで解くのね |