
贪心
文章平均质量分 87
君卿
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
会场安排 (南阳理工oj简单贪心)
描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,请问他该如何安排。输入第一行是一个整型数m(m<100)表示共有m组测试数据。每组测试数据的第一行是一个整数n(1<n<10000)表示该测试数据共有n个活动。...原创 2018-05-07 22:36:58 · 163 阅读 · 0 评论 -
链条 简单贪心 (可以和会长时间安排类比)
给出n对数字,每个对数字由两个数a和b构成,其中a<b,现在用一些对拼成最长的链,要使得 b1 < a2, b2 < a3 ... 求最长链的长度。Input有多组测试数据。每组测试数据的第一行有一个数字N(1<=N<=10^5)。接下来有n对数字ai和bi,数据保证保证ai<bi,0<=ai,bi<=10^9。处理到文件结束。Output对于每组测...原创 2018-05-07 22:32:58 · 236 阅读 · 0 评论 -
独木舟 贪心
#include<iostream>#include<algorithm>using namespace std;long long a[10010];int main(){ long long n,k=0; long long i,t=0,max; cin>>n>>max; for(i=0;i<n;i++) { cin>>a[i...原创 2018-04-12 13:07:34 · 243 阅读 · 0 评论 -
A - Stages 简单贪心
Natasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be des...原创 2018-07-28 15:20:04 · 247 阅读 · 0 评论 -
vacations 暴力求解
Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this n days: whether that gym opened and whether a contest was c...原创 2018-08-02 18:06:59 · 279 阅读 · 0 评论