2011-04-19から1日間の記事一覧
縦方向と横方向でそれぞれDPして、後で掛け合わせる。 結構ややこしい。 #include<cstdio> #include<algorithm> using namespace std; typedef long long ll; const int mod = 10000000; int dp[2][1001]; int main(){ int w[2], n, o = 0, p = 1, q = 1; char a; scanf("%d%d%d</algorithm></cstdio>…