随笔分类 -  贪心

摘要:#include#include#include#include#include#include //friend bool operator b.coun; } priority_queue Q;using namespace std;struct node{ int num; ... 阅读全文
posted @ 2015-07-02 01:43 sola94 阅读(186) 评论(0) 推荐(0)
摘要:题意:思路:#include#include#include#include#include#include#include#include#includeusing namespace std;struct Work{ __int64 c,d;};Work work[100000+10];i... 阅读全文
posted @ 2015-06-10 05:03 sola94 阅读(153) 评论(0) 推荐(0)
摘要:题意:http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=578&pid=1001思路:讲述列从大到小排列 先把数量多的数字剪掉 最后遍历求和#include#include#include#includeusing... 阅读全文
posted @ 2015-05-23 21:16 sola94 阅读(94) 评论(0) 推荐(0)
摘要:#include#include#include#include#include#includeusing namespace std;#define MAXN 100000+10int n,st[MAXN],cnt,a[MAXN],kill[MAXN]={0},f[MAXN]={0};int ma... 阅读全文
posted @ 2015-05-19 21:34 sola94 阅读(233) 评论(0) 推荐(0)
摘要:题意:思路:#include#include#include#include#include#include#include#include#include#define LL __int64using namespace std;const int MAXN=1000+5;const int IN... 阅读全文
posted @ 2015-04-21 11:28 sola94 阅读(111) 评论(0) 推荐(0)
摘要:#include#include#include#include#include#include#includeusing namespace std;int a[1000000+10];char str[1000000+10];int main(){ int n; int i,j,k;... 阅读全文
posted @ 2015-04-20 09:35 sola94 阅读(121) 评论(0) 推荐(0)
摘要:#include#include#include#include#include#include#include#include#include#define LL __int64using namespace std;const double EPS=1e-9;const int MAXN=100... 阅读全文
posted @ 2015-03-26 16:50 sola94 阅读(158) 评论(0) 推荐(0)
摘要:http://acm.csu.edu.cn/OnlineJudge/showsource.php?id=97234#include#include#include#include#includeusing namespace std;int main(){ //freopen("output.tx... 阅读全文
posted @ 2015-03-15 21:03 sola94 阅读(220) 评论(0) 推荐(0)
摘要:http://codeforces.com/contest/507/problem/A#include#include#include#includeusing namespace std;struct Num{ int v; int id;};Num num[100+10];int c... 阅读全文
posted @ 2015-01-24 15:59 sola94 阅读(305) 评论(0) 推荐(0)
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3519题意 :caocao能够战胜每一个人 战胜智商比他高的加2点智商 否则加1点 问经过辩论后能得到的最高智商值为多少思路:在辩论中一直和智商比自己高的比 把比自己低的... 阅读全文
posted @ 2015-01-23 10:19 sola94 阅读(132) 评论(0) 推荐(0)
摘要:DescriptionAssume the coasting is an infinite straight line.Land is in one side of coasting, sea in the other.Each small island is a point locating in... 阅读全文
posted @ 2014-08-15 00:21 sola94 阅读(135) 评论(0) 推荐(0)
摘要:Descriptiontwo hundred silver dollars from the loser.""Being the most powerful man in the country,the king has so nice horses that in each class his h... 阅读全文
posted @ 2014-08-13 11:03 sola94 阅读(180) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1789题意: 每个老师都会给出交作业的期限和没按时交会扣掉的分数 要求出扣除最少分数的情况思路:是一题典型的贪心把扣除分数多的科目排在前面并排在尽量晚的位置#include#include#include#incl... 阅读全文
posted @ 2014-08-09 00:33 sola94 阅读(127) 评论(0) 推荐(0)