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

POJ 1631 Bridging signals

POJ

問題解法 最長増加部分列(LIS)をとけばよい spaghetti source みてLISをO(n log n)で解くアルゴリズムをみた #include <cstdio> #include <vector> #include <algorithm> using namespace std; const int INF = 1 << 29; const int MAX_P = 40000; int T, P; int a[MAX_P]; int solve_li</algorithm></vector></cstdio>…

2012年振り返り

2012年がもうすぐ終わるので振り返りを書きます。1月 蟻本でアルゴリズムを勉強する。 2月 JOI本選のことがツイッターでつぶやかれているのをみる。来年行きたいなーと思う。 3月 高校受験。やべぇ勉強全然していない。 →なぜか受かったのでよかった 4月 高…

AOJ 0541 散歩

問題解法 10^7回も散歩する太郎君の問題 解説みた。動的計画法を使う。 #include <cstdio> #include <algorithm> using namespace std; const int MAX_HW = 1000; int N, H, W; int a[MAX_HW + 2][MAX_HW + 2]; int dp[MAX_HW + 2][MAX_HW + 2]; int main(){ while(scanf("%d %d</algorithm></cstdio>…