# Doing homework again(贪心)】的更多相关文章

Doing Homework again 这只是一道简单的贪心,但想不到的话,真的好难,我就想不到,最后还是看的题解 [题目链接]Doing Homework again [题目类型]贪心 &题意: Ignatius有N项作业要完成.每项作业都有限期,如果不在限期内完成作业,期末考就会被扣相应的分数.给出测试数据T表示测试数,每个测试以N开始(N为0时结束),接下来一行有N个数据,分别是作业的限期,再有一行也有N个数据,分别是若不完成次作业会在期末时被扣的分数.求出他最佳的作业顺序后被扣的最小的…
Doing Homework again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13847    Accepted Submission(s): 8036 Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he h…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 /*Doing Homework again Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7903 Accepted Submission(s): 4680 Problem Description Ignatius has just c…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Eve…
Doing Homework again 点我挑战题目 题意分析 给出n组数据,每组数据中有每份作业的deadline和score,如果不能按期完成,则要扣相应score,求每组数据最少扣除的score是多少. 典型的贪心策略. 既然是要求最少的扣分,那么肯定是要先完成分数最多的.所以可以推出按照分数排序.那么最佳策略应该是在deadline当天完成作业,如果那天已经占用,只能在deadline-1天完成,如果那天也被占用了,就只能在deadline-2天完成--直到推到第1天,如果还被占用的话…
I - Doing Homework again Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description zichen has just come back school from the 30th ACM/ ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of hand…
Doing Homework again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10705    Accepted Submission(s): 6299 Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he h…
Doing Homework again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18294    Accepted Submission(s): 10648 Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he…
题目链接:https://cn.vjudge.net/problem/HDU-1789 题意 小明有一大堆作业没写,且做一个作业就要花一天时间 给出所有作业的时间限制,和不写作业后要扣的分数 问如何安排作业,使被扣分最少 思路 因为有日期这个规定,所以可以提前写作业 有一个思路,复杂度是O(n^2) 就是先算得n天内的最小扣分的安排,然后在n+1天时用第n+1天期限的作业更新一边最小扣分安排 考虑时间1000ms规模1000个数据,O(n^2)太冒险,所以考虑贪心 贪心思路O(n) 为了让扣分最…
题意: 给定n个点,每个点有权值a[i],从A走到B的花费是下取整sqrt(a[i]-a[j]),求从1号点走到n号点的最小花费 1<=n,a[i]<=1e5 思路: #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<iostream> #include<algorithm> #include<map> #i…