贪心
zz328
。。。。
展开
-
POJ 3617
题目链接http://poj.org/problem?id=3617简单贪心题.每次贪开头和结尾最小的字符即可#include using namespace std;char s[2111];int n;void solve(){ int a=0,b=n-1,i,cnt=0; while(a<=b) { bool fl原创 2014-03-27 13:07:32 · 366 阅读 · 0 评论 -
POJ 1789
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1789也是一道简单的贪心,用到了结构体排序而已.#include #include #include using namespace std;int t,n,ans;int v[1111];struct xx{ int ff; int tt;}a[原创 2014-03-27 14:17:28 · 387 阅读 · 0 评论 -
HDU 2124
英文题看懂不容易= =http://acm.hdu.edu.cn/showproblem.php?pid=2124#include #include using namespace std;long long l;long long N[666];int n;int cmp(int a,int b){ return a>b;}void solve(){原创 2014-03-27 16:39:42 · 471 阅读 · 0 评论