hdu 5562 Clarke and food(贪心)】的更多相关文章

Problem Description Clarke is a patient with multiple personality disorder. One day, Clarke turned into a cook, was shopping for food. Clarke has bought n food. The volume of the ith food is vi. Now Clarke has a pack with volume V. He wants to carry…
HDU 5628 Clarke and math 本文属于一个总结了一堆做法的玩意...... 题目 简单的一个式子:给定$n,k,f(i)$,求 然后数据范围不重要,重要的是如何优化这个做法. 这个式子有$n$种问法,而且可以变式扩展,所以说这个式子也是比较重要的: 我们约定如果给定了$n,k$那么我们的$g$写作$g_k(n)$,如果给定了$n,k$中间的任意一个,枚举另一个,或者另一个是变化的,那么另一个数记为$i,j$ 把$1~n$或$1~k$的$g_k(i)$或$g_i(n)$都求出来…
hdu 4825 Xor Sum(trie+贪心) 刚刚补了前天的CF的D题再做这题感觉轻松了许多.简直一个模子啊...跑树上异或x最大值.贪心地让某位的值与x对应位的值不同即可. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define CLR(a,b) memset((a),(b),sizeof(…
Problem Description Clarke is a patient with multiple personality disorder. One day, Clarke turned into a game player of minecraft. On that day, Clarke set up local network and chose create mode for sharing his achievements with others. Unfortunately…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5627 题意:Bestcoder的一道题,让你求&意义下的最大生成树. 解法: 贪心,我们从高位到低位贪心,如果含有这一位的边能够构成一棵树的话,我们就可以直接把其他不含有这一位的边全部去掉 然后重复这个行为 这个贪心显然正确啦,至于判断能否构成一颗树,就用并查集就好啦 //HDU 5627 #include <bits/stdc++.h> using namespace std; cons…
Elegant Construction 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5813 Description Being an ACMer requires knowledge in many fields, because problems in this contest may use physics, biology, and even musicology as background. And now in this prob…
Windows 10 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5802 Description Long long ago, there was an old monk living on the top of a mountain. Recently, our old monk found the operating system of his computer was updating to windows 10 automatical…
Clarke and baton Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5565 Description Clarke is a patient with multiple personality disorder. One day, Clarke split into n guys, named 1 to n. They will play a game ca…
Clarke and five-pointed star Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5563 Description Clarke is a patient with multiple personality disorder. One day, Clarke turned into a learner of geometric. When he d…
Reorder the Books Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5500 Description dxy家收藏了一套书,这套书叫<SDOI故事集>,<SDOI故事集>有n(n≤19)n(n\leq 19)n(n≤19)本,每本书有一个编号,从111号到nnn号. dxy把这些书按编号从小到大,从上往下摞成一摞.dxy对这套书极其重视,不允许…