HDU-6709 Fishing Master】的更多相关文章

传送门 •参考资料 [1]:2019CCPC网络选拔赛 H.Fishing Master(思维+贪心) •题意 池塘里有 n 条鱼,捕捉一条鱼需要花费固定的 k 时间: 你有一个锅,每次只能煮一条鱼,其中煮熟第 i 条鱼至少需要 ti 时间: 你在煮鱼的时候可以选择去钓一条鱼,也可也选择不钓: 但是,一旦你决定钓鱼,就必须花费 k 时间调到一条鱼: 任何时刻,你都可以有多条鱼待煮: 问将所有的鱼钓上来并煮熟所有的鱼最少需要多少时间: •题解 理想的方案是只有在钓第一条鱼的时候锅是空的,其余任意时…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=6709 Fishing Master Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 631    Accepted Submission(s): 170 Problem Description Heard that eom is a fishin…
题目网站:http://acm.hdu.edu.cn/showproblem.php?pid=6709 Problem Description Heard that eom is a fishing MASTER, you want to acknowledge him as your mentor. As everybody knows, if you want to be a MASTER’s apprentice, you should pass the trial. So when yo…
Description Heard that eom is a fishing MASTER, you want to acknowledge him as your mentor. As everybody knows, if you want to be a MASTER's apprentice, you should pass the trial. So when you find fishing MASTER eom, the trial is as follow: There are…
题意分析 题意:题目给出n条鱼,以及捕一条鱼所用的时间k,并给出煮每一条鱼的时间,问抓完并煮完所有鱼的最短时间. 附题目链接 思路: 1.捕第一条鱼的时间是不可避免的,煮每条鱼的时间也是不可避免的,这些都要算上. 2.可以优化的是煮鱼的时间,在时间允许的范围内可进行捕其他鱼.当然煮鱼的时间也许不够捕其他鱼,这就需要增加额外的时间. 3.设在煮每条鱼煮的时间内抓的最多的鱼数为cnt,捕鱼的时间为cost,将每次额外增加的时间存储在一个数组中,记为fre[ ]. 4.更多详细信息在代码中给出. AC…
题目链接:https://vjudge.net/problem/HDU-6709 题意:给出n条鱼的抓捕时间k和煮鱼时间a[i],你要在最短时间把所有鱼都煮了.(注意你只有一口锅) 思路:首先我们必须要花K时间抓一条鱼,然后考虑最佳状态是你在煮第一条鱼的时间就可以把其他鱼都抓了,那么就没有浪费时间.所以我们只要考虑在煮鱼的情况下能抓多少鱼num+=a[i]/k;如果num>=n-1没有时间浪费,否则少几条就要浪费一点时间,只要对a[i]%k从大到小排序,浪费的时间就是(k-a[i]%k). 1…
Mart Master II Time Limit: 6000ms Memory Limit: 65536KB This problem will be judged on HDU. Original ID: 501664-bit integer IO format: %I64d      Java class name: Main Trader Dogy lives in city S, which consists of n districts. There are n - 1 bidire…
题意 http://acm.hdu.edu.cn/showproblem.php?pid=6709 思考 先考虑所有鱼的烹饪时间小于k的情况.将T从大到小排序后,煮一条鱼相当于将其时间补齐至k. 由于鱼的烹饪时间会大于等于k,那么,最优解一定不会出现鱼不够煮的情况.在煮鱼期间,可以钓到$\frac{t_i}{k}$条鱼,最后要补齐的鱼的数量有n-cnt-1条.-1是因为最开始没有鱼. 代码 #include<bits/stdc++.h> using namespace std; typedef…
Problem Description Master Mind KongMing gave Fei Zhang a secrete master plan stashed × matrix, but Fei didn't know the correct direction to hold the sheet. What a pity! Given two secrete master plans. The first one is the master's original plan. The…
Dungeon Master Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 17555   Accepted: 6835 Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled…