这题真是太神了! 考试的时候冲着四十分写了个$O(\frac{N^3logN}{32})$的制杖算法。 然后就狠狠的T掉了。如果没有充分的理解单调性和应用单调性就只有10分的傻逼分拿了。 首先考虑枚举两维,那么随着第二维的递增,第三维必定不上升,搞个指针瞎贪贪就是$O(N^2)$了(而我却SB的硬上 ...
分类:
其他好文 时间:
2017-02-17 20:09:20
阅读次数:
219
详见大牛背包九讲(下载地址:http://pan.baidu.com/s/1b9edXW) ...
分类:
其他好文 时间:
2017-02-17 13:53:30
阅读次数:
241
写程序需要将string转化为int,所以就探索了一下。 方法一:atoi函数 atoi函数将字符串转化为整数,注意需要stdlib库。所以就尝试了一下: 然而却发现报错: 显然,atoi需要的事const char*类型,而我上面给的上string类型,所以就要 多加一个函数string.c_st ...
分类:
编程语言 时间:
2017-02-17 12:51:41
阅读次数:
216
1 //用c++的sort可以过 2 #include 3 int main() 4 { 5 int n; 6 while(~scanf("%d",&n)) 7 { 8 int ans,ant,num=0; 9 while(n--) 10 { 11 scanf("%d",&ant);... ...
分类:
其他好文 时间:
2017-02-16 23:48:40
阅读次数:
168
1 //只需要一个数组存可用系统最高拦截高度 2 #include 3 int s[6000]; 4 int main() 5 { 6 int n; 7 while(~scanf("%d",&n)) 8 { 9 int ans=1,top=-1,x,i,j; 10 for(i=0; i= x) 20... ...
分类:
其他好文 时间:
2017-02-16 23:23:28
阅读次数:
195
这题似乎就是纯概率论。。 E(V)=D(X_i)=npq (p=1/m,p+q=1) ...
分类:
其他好文 时间:
2017-02-16 15:39:52
阅读次数:
136
FriendlyARM tiny4412 uboot移植之SD Card用起来Kernel boot起来 ...
分类:
其他好文 时间:
2017-02-16 14:50:07
阅读次数:
951
#include <iostream>using namespace std;int main(){ int a,b,c,m=0,s[3]; for(a=1;a<7&&m==0;a++) for(b=0;b<7&&m==0;b++) for(c=1;c<7&&m==0;c++) if((c+b*7+ ...
分类:
其他好文 时间:
2017-02-16 01:28:51
阅读次数:
191
Example 1234567891011121314151617181920212223242526272829303132 /* setlocale example */ #include <stdio.h> /* printf */ #include <time.h> /* time_t, s ...
分类:
编程语言 时间:
2017-02-15 22:19:13
阅读次数:
396
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1242 参考链接:http://www.acmerblog.com/hdu-1242-Rescue-1605.html 普通队列+bfs确实是蒙对的,因为击败守卫需要消耗时间1,因此普通队列每一次出队列的 ...
分类:
其他好文 时间:
2017-02-15 21:12:35
阅读次数:
178