2015-04-04から1日間の記事一覧
dp[i]: 最後にiを使って行ったケース(この値そのものが行き方の総数ではなく、総数になるように上手く補正する(可能な行き方が減る)のをdp[j]->dp[i]やdp[i]->ansで更新するときに計算する)なかなか見ないタイプのDPで結構難しい。 #include<stdio.h> #include<algorithm> using </algorithm></stdio.h>…
明らかに問題文に不備があるので、AtCoderから実際にコンテストが行われたときのclarをさがしてきましょう。下の角のマスの隣(下線と同じy座標で盤面の外)はゴールではありません。 #include<stdio.h> #include<algorithm> #include<map> using namespace std; char str[31][31]; int </map></algorithm></stdio.h>…