摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1896题意:Sempr在走路时,如果遇到为奇数的石头,就把它往前扔,遇到为偶数的石头则不处理,要是同一位置有多个石头,则先扔最重的石头(也就是扔的最近的那个石头),要你求扔的石头离初始位置的最大距离。#include<iostream>#include<queue>using namespace std;struct ss{ friend operator<(const ss a,const ss b) { if(a.p>b.p) return 1; ... 阅读全文
posted @ 2012-12-02 16:16 紫忆 阅读(419) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1509#include<iostream>#include<queue>using namespace std;struct ss{ friend operator<(const ss a,const ss b) { if(a.v>b.v) return 1; else if(a.v==b.v&&a.num>b.num) return 1; else return 0; } int num,v,sum; char s[50];};int main(){ 阅读全文
posted @ 2012-12-02 16:09 紫忆 阅读(293) 评论(0) 推荐(0) 编辑