2009-11-25から1日間の記事一覧

SRM453.5 Div1 Medium(450) PlanarGraphShop

PlanarGraphShop動的計画法。c 個のグラフで n コインとなるなら、c+1 個のグラフの組み合わせで n+1, c+8, c+9, c+27, ……コインを作れる。 グラフが平面グラフとなる条件はWikipediaより、 Gが平面的グラフならば、|E(G)|≦3|V(G)|-6。ただし、|V(G)|≧3。X=2…

SRM453.5 Div1 Easy(250) MazeMaker

MazeMaker1日勘違いしてて、参加し損ねた。ぐぬぬ。 #include <vector> #include <string> using namespace std; class MazeMaker { public: int longestPath( vector<string> maze, int startRow, int startCol, vector<int> moveRow, vector<int> moveCol ); }; int MazeMaker::longestPath(</int></int></string></string></vector>…