HDU 3697贪心】的更多相关文章

额...大意是你可以决定什么时候选课.然后呢.每五分钟只有一次机会选.每种课限制选课时间.问你能选到的课最多有多少. 感觉一点都不水.是自己太菜了吗? #include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> using namespace std; struct Node { int l, r; } node[]; int cmp(Node a, Node b)…
#include<stdio.h> #include<stdlib.h> #include<string.h> #define inf 0x3fffffff #define N 1100 struct node { int l,r; }f[N]; int ff[N]; double d; int Min(int aa,int bb) { return aa>bb?bb:aa; } int Max(int aa,int bb) { return aa>bb?a…
题目链接:pid=3697" target="_blank">http://acm.hdu.edu.cn/showproblem.php?pid=3697 Problem Description     A new Semester is coming and students are troubling for selecting courses. Students select their course on the web course system. There…
Description     A new Semester is coming and students are troubling for selecting courses. Students select their course on the web course system. There are n courses, the ith course is available during the time interval (A i,B i). That means, if you…
题意: 一个学生要选课,给出一系列课程的可选时间(按分钟计),在同一时刻只能选一门课程(精确的),每隔5分钟才能选一次课,也就是说,从你第一次开始选课起,每过5分钟,要么选课,要么不选,不能隔6分钟再选.在给出的课程的事件Ai~Bi内,Bi起的那分钟是不能够选的了,就是说截止到(Bi-1)分钟59秒还能选,Bi就不能选了. 思路: 由于n最大才300,那就可以使用暴力解法.开始时刻可以从0~4分钟这5个时刻开始,因为每5分钟是个周期,比如0分没选,而5分才选了,这和从5分才开始选是一样的.每隔5…
Description     A new Semester is coming and students are troubling for selecting courses. Students select their course on the web course system. There are n courses, the ith course is available during the time interval (Ai,Bi). That means, if you wa…
Selecting courses Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 62768/32768 K (Java/Others) Total Submission(s): 1856    Accepted Submission(s): 469 Problem Description     A new Semester is coming and students are troubling for selecting c…
题目: http://acm.hdu.edu.cn/showproblem.php?pid=5289 Assignment Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3175    Accepted Submission(s): 1457 Problem Description Tom owns a company and he i…
http://acm.hdu.edu.cn/showproblem.php?pid=4803 话说C++还卡精度么?  G++  AC  C++ WA 我自己的贪心策略错了 -- 就是尽量下键,然后上键,最后下键补全,可是例子都过不了..... 题解參考http://www.cnblogs.com/xuesu/p/3967704.html http://www.cnblogs.com/Canon-CSU/p/3451784.html http://blog.csdn.net/keshuai199…
戳我穿越:http://acm.hdu.edu.cn/showproblem.php?pid=1735 对于贪心,二分,枚举等基础一定要掌握的很牢,要一步一个脚印走踏实 这是道贪心的题目,要有贪心的意识. 首先将所有为0的地方统计,因为是求最小的字数,所有最后一行后面的0可以看为空格直接减掉, 因为有m段(一定包括第一行),再减去m*2,最后枚举每行,将至少前两个为0的上一行的最后有多少 的0统计起来排序,再依次减去前m-1个大的,这样就保证了得到的答案是符合条件中最小的 code #inclu…