HDU4882ZCC Loves Codefires(贪心)】的更多相关文章

ZCC Loves Codefires Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 823 Accepted Submission(s): 438 Problem Description Though ZCC has many Fans, ZCC himself is a crazy Fan of a coder, called "Mem…
 ZCC Loves Codefires Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 223    Accepted Submission(s): 123 Problem Description Though ZCC has many Fans, ZCC himself is a crazy Fan of a coder, ca…
题目链接 做题的时候凑的规律,其实可以 用式子推一下的. 题意:n对数,每对数有e,k, 按照题目的要求(可以看下面的Hint就明白了)求最小的值. 分析:假设现在总的是sum, 有两个e1 k1 e2 k2 则先选e1 为 (sum+e1)*k1+(sum+e1+e2)*k2 先e2: (sum+e2)*k2 + (sum+e1+e2)*k1. 比较两个式子发现不同的部分分别是 e1*k2   e2*k1; 比较大小移向 e1/k1  e2/k2, 那个小,就选那个,能达到最小. 官方题解:…
ZCC Loves Codefires 题目链接: http://acm.hust.edu.cn/vjudge/contest/121349#problem/B Description Though ZCC has many Fans, ZCC himself is a crazy Fan of a coder, called "Memset137". It was on Codefires(CF), an online competitive programming site, th…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4882 ---------------------------------------------------------------------------------------------------------------------------------------------------------- 欢迎光临天资小屋:http://user.qzone.qq.com/593830943…
ZCC Loves Codefires Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 790    Accepted Submission(s): 420 Problem Description Though ZCC has many Fans, ZCC himself is a crazy Fan of a coder, called…
http://acm.hdu.edu.cn/showproblem.php?pid=4882 ZCC Loves Codefires Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 97    Accepted Submission(s): 55 Problem Description Though ZCC has many Fans,…
Though ZCC has many Fans, ZCC himself is a crazy Fan of a coder, called "Memset137". It was on Codefires(CF), an online competitive programming site, that ZCC knew Memset137, and immediately became his fan. But why? Because Memset137 can solve a…
题目链接 题意 : 给出n个问题,每个问题有两个参数,一个ei(所要耗费的时间),一个ki(能得到的score).每道问题需要耗费:(当前耗费的时间)*ki,问怎样组合问题的处理顺序可以使得耗费达到最少. 思路 : 如果有两个样例,e1=10,e2 = 20,k1 = 1 ,k2 = 3 : 先解决第一个问题 : 10 * 1 + (10 + 20 ) * 3 先解决第二个问题 : 20 * 3 + (20 + 10) * 1 展开之后发现两个只有10 * 3 与 20 * 1是不同的.所以排序…
类似某noip国王游戏. 考虑交换两个题目的顺序,仅会对这两个题目的贡献造成影响. 于是sort,比较时计算两个题目对答案的贡献,较小的放在前面. #include<cstdio> #include<algorithm> using namespace std; typedef long long ll; struct Point{ll T,K;}a[100001]; bool operator < (const Point &a,const Point &b…