2011-11-16から1日間の記事一覧
3618 貪欲 #include <cstdio> #include <cmath> #include <algorithm> using namespace std; struct t { int cost, flag; t() { flag = 1; } }; class Comp { public: bool operator() (const t& a, const t& b) { return abs(a.cost) < abs(b.cost); } }; int main() { int T, N; scan</algorithm></cmath></cstdio>…