贪心算法,同类于看电视的还有老鼠拿钱和猫换食物。
#include
#include
using namespace std;
struct time {
int s;
int e;
bool operator < (const time &A) const {
return e < A.e;
}
}buf[101];
int main() {
int n, i, ans, currentTime;
while(scanf("%d", &n) != EOF) {
if(n==0) break;
for(i=0; i