解题思路 明明一道比较简单的贪心结果挂了好几次23333,就是按照时间排序,然后拿一个小根堆维护放进去的,如果时间允许就入队并且记录答案.如果不允许就从堆里拿一个最小的比较. #include<bits/stdc++.h> using namespace std; ; inline int rd(){ ,f=;char ch=getchar(); :;ch=getchar();} )+(x<<)+ch-';ch=getchar();} return f?x:-x; } int n,
Summer Holiday Time Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4574 Accepted Submission(s): 2078 Problem Description To see a World in a Grain of Sand And a Heaven in a Wild Flower, Hold Inf
https://www.luogu.org/problem/P2949 题目描述 Farmer John has so very many jobs to do! In order to run the farm efficiently, he must make money on the jobs he does, each one of which takes just one time unit. His work day starts at time 0 and has 1,000,00
Summer Holiday Time Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 27 Accepted Submission(s): 20 Problem Description To see a World in a Grain of Sand And a Heaven in a Wild Flower, Hold Infinity i
A. Lucky Year time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lu
http://uoj.ac/problem/29 经过的点集一定是一个包含start的区间,为了经过这个区间内所有点,必须先到达一个区间端点,再到达另一个区间端点,剩余的步数则贪心选区间内最大价值的点.显然决策单调,于是可以分治,用可持久化线段树快速求出区间前k大数之和. #include"holiday.h" #include<cstring> #include<algorithm> typedef long long i64; ; i64 ans=; int
题目链接:http://codeforces.com/problemset/problem/93/B B. End of Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Students love to celebrate their holidays. Especially if the holiday is th
P2949 [USACO09OPEN]工作调度Work Scheduling 题目描述 Farmer John has so very many jobs to do! In order to run the farm efficiently, he must make money on the jobs he does, each one of which takes just one time unit. His work day starts at time 0 and has 1,000
1603: Scheduling the final examination Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 49 Solved: 15 Description For the most of the university students,what they most want is that they can obtain 60 points from the final examination of every subjec