2019-12-31から1日間の記事一覧
https://atcoder.jp/contests/past201912-open/tasks/past201912_j 前提知識 ダイクストラ 解説 https://atcoder.jp/contests/past201912-open/submissions/9257724 難しい問題。 左下を点X, 右下を点Y, 右上を点Zとしておこう。 簡単にX->Yの最短距離+Y->Z…
https://atcoder.jp/contests/past201912-open/tasks/past201912_i 前提知識 bitDP 解説 https://atcoder.jp/contests/past201912-open/submissions/9257465 bitDPを知らないと解くのは難しい。 もしわからない場合は、bitdpでググって概要を理解してきて欲…
https://atcoder.jp/contests/past201912-open/tasks/past201912_h 解説 https://atcoder.jp/contests/past201912-open/submissions/9257326 さて、色々な操作があるが、愚直に操作していくと、O(QN)となって間に合わない。 セット販売と全種類販売について…
https://atcoder.jp/contests/past201912-open/tasks/past201912_g 解説 https://atcoder.jp/contests/past201912-open/submissions/9253193 競技プログラミング的なやりかたで解決する。 3つ以下のグループに分けるので、全てのやり方を試してもO(3N)である…
https://atcoder.jp/contests/past201912-open/tasks/past201912_f 解説 https://atcoder.jp/contests/past201912-open/submissions/9253007 単語は大文字2つで挟まれているので、大文字が2つ現れた時点で文字列を分裂していく。 単語分割が問題の最も難しい…
https://atcoder.jp/contests/past201912-open/tasks/past201912_e 解説 https://atcoder.jp/contests/past201912-open/submissions/9252782 実装が厳しくなってくる。 N≦100なので、計算量は雑にやっても問題ない。 follow[i][j] := iがjをフォローしている…
https://atcoder.jp/contests/past201912-open/tasks/past201912_d 解説 https://atcoder.jp/contests/past201912-open/submissions/9252399 サンプル1の説明を見ると、個数が重要そうである。 書き換えが発生していなかった場合は、全て1個であるパターンで…
https://atcoder.jp/contests/past201912-open/tasks/past201912_c 解説 https://atcoder.jp/contests/past201912-open/submissions/9252314 A~Fを降順ソートして3番目を答えればよい。 ソートするために配列に入れるので、入力を受け付けるときもA,B,...と…
https://atcoder.jp/contests/past201912-open/tasks/past201912_b 解説 https://atcoder.jp/contests/past201912-open/submissions/9252279 隣り合う2要素について、実装をしていく問題。 実装を頑張る問題であり、特に注意点も無いが、vectorのsizeメソッ…
https://atcoder.jp/contests/past201912-open/tasks/past201912_a 解説 https://atcoder.jp/contests/past201912-open/submissions/9252220 入力はエラーとなる場合があるので、整数ではなく、文字列で読み込もう。 IntParse的なやつを使って、例外が出たら…