2011-05-24から1日間の記事一覧

5月 DUO リスニングで音節が聞き取れなかったところ。

聞けなかったところを聞き取れるようにするというより、どうして聞き取れなかったか、何か理由があるはずだから、それを探って次にいかす. Section1 1: will of the //of theが意味のある単語に聞こえる willがうぅるとかにきこえる 2:can assure you//きゃ…

動的計画法(メモ化)の研究

再帰、メモ再帰、動的計画法とは? 有名な??階乗計算を例に取る。 //純粋な再帰。同じ引数を持つ関数を何度も何度も呼び出している。→むだやん。 #include <iostream> #include <cstdio> using namespace std; int fib(int n) { if(n<=1) return n; return fib(n-1)+ fib(n-2</cstdio></iostream>…

SRM308 div2 difficult [典型的なナップサック問題]

#define TR_MAX 50 class TreasuresPacking { private: typedef struct _things { int weight; int cost; bool flex; } Things; public: double maximizeCost(vector treasures, int W) { int sz = treasures.size(); vector tr(sz); for(int i = 0; i flex …