2019-02-27から1日間の記事一覧

POJ3176

蟻本の練習問題として載ってるPOJの問題3176。 簡単なDPの解答。 大雑把にO(n2)で収まるぐらいの計算量で解いた。以下、解答 #include <cstdio> #include <algorithm> using namespace std; #define MAX_A 500 int n, a[MAX_A][MAX_A], dp[MAX_A+1][MAX_A+1]; int solve(int n) </algorithm></cstdio>…

タイガーブックを読む前に2

前記事で、smlnjのインストールをやった。 そのあと本通りにやると、 CM.make(); で以下のようなエラーが。 stdIn:1.2-1.11 Error: operator and operand do not agree [tycon mismatch] operator domain: string operand: unit in expression: CM.make () C…