随笔分类 - 贪心
摘要:The secret codeInput file: stdinOutput file: stTime limit: 1 secMemory limit: 256 MbAfter returning from the trip, Alex was unpleasantly surprised: hi...
阅读全文
摘要:题目大意: 给出一串序列Ai{0,1},求一个序列Bi[0,1](Bi#include #include using namespace std;struct Edge{ int sum,len;};int a[1000005];stack q;int main(){ //freope...
阅读全文
摘要:Nested DollsTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2643Accepted Submission(s): 785Problem...
阅读全文
摘要:先给个LCA模板HDU 1330(LCA模板)#include #include #define N 40005struct Edge{ int x,y,d,ne;};Edge e[N*2],e2[N*2];int be[N],be2[N],all,all2,n,m;bool vis[N];i...
阅读全文
摘要:考试时,想到了一个很类似的方法,但是总是差那么点,就是这么点,需要不断的努力啊!!!题解:基本思想是贪心。对于价值c=500*xi+2*yi,yi最大影响100*2#include #include #include using namespace std;typedef long long LL;...
阅读全文
摘要:题目描述有些坑。。题意: 有一条高速公路在x轴上,从(0,0)到(L,0)。周围有一些村庄,希望能够在高速公路上开通几个出口,使得每个村庄到最近的出口距离小于D,求出最少需要开通多少个出口。解题思路: 典型的区间问题,将每个点化为区间(x-sqrt(D^2-y^2),x+sqrt(D^2+y^2...
阅读全文

浙公网安备 33010602011771号