2012-12-29から1日間の記事一覧

AOJ 0141 - Spiral Pattern

aoj

n=2だけ特別視 #include<iostream> #include<algorithm> #include<cstdio> int main(){ const int MAX_N = 100; const int dx[] = {0, 1, 0, -1}, dy[] = {-1, 0, 1, 0}; int d, n; std::cin >> d; for(int k=0;k<d;k++){ std::cin >> n; if(k > 0){ std::cout << std::endl; } if(n == 2){ std::cout << "##\</d;k++){></cstdio></algorithm></iostream>…

AOJ 0120 - Patisserie

aoj

すこしbitDP書けるようになった.いままでループで,はじめてメモ化再帰書いた. こっちのほうがいいかも.Sは今まで使ったケーキ,vはさっき使ったケーキ dp[S][v]は残りのケーキでできる最小幅. 全ケーキの幅になるよう最初に使ったケーキの半径と最後に…