2012-03-19から1日間の記事一覧

AOJ_0105 Book Index

問題 解法 STLゲー。 map を使って単語と出現ページの情報を管理する。 #include <cstdio> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #include <algorithm> using namespace std; typedef priority_queue<int, vector<int>, greater<int> > PAGE; typedef map<string, PAGE> INDEX; int main(){ char b…</string,></int></int,></algorithm></vector></string></queue></map></iostream></cstdio>

AOJ_0201 Wrought Gold Master

問題 解法 STLゲー。mapをアイテムの値段用とレシピ用に2つ使う。 再帰で最小の金額を求めていく。 #include <cstdio> #include <iostream> #include <map> #include <vector> #include <algorithm> using namespace std; typedef map<string, int> ITEM; typedef map<string, vector<string> > RECIPE; ITEM item; RECIPE recipe; int solve</string,></string,></algorithm></vector></map></iostream></cstdio>…