摘要: #include #include using namespace std;int a[101],n;void quicksort(int left,int right){ int i,j,t,tmp; if(left>right) return ; //当i变为lef... 阅读全文
posted @ 2016-06-19 23:21 弃用博客 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 1.#define INF (1ll<<60)-1 表示义INF的值为2^60-1 阅读全文
posted @ 2016-06-18 17:16 弃用博客 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 进制转换 Problem Description 输入一个十进制数N,将它转换成R进制数输出。 Input 输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(210)。 Output 为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的... 阅读全文
posted @ 2016-06-18 17:09 弃用博客 阅读(158) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;long long tmp[70000]; //存下到目前数组下标位置存下的数位的数量long long n;long long tmp2;int flag;void my_search(int l, int r){ ... 阅读全文
posted @ 2016-06-05 18:32 弃用博客 阅读(99) 评论(0) 推荐(0) 编辑
摘要: find the nth digit Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 11272 Accepted Submis... 阅读全文
posted @ 2016-06-05 17:09 弃用博客 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 一、概念 时间复杂度是总运算次数表达式中受n的变化影响最大的那一项(不含系数) 比如:一般总运算次数表达式类似于这样: a*2^n+b*n^3+c*n^2+d*n*lg(n)+e*n+f a ! =0时,时间复杂度就是O(2^n); a=0,b0 =>O(n^3); a,b=0,c0 =>O(... 阅读全文
posted @ 2016-06-03 20:24 弃用博客 阅读(801) 评论(0) 推荐(0) 编辑
摘要: 一开始直接把case++写在输出位置,结果PE,以为是有什么问题,结果是自己在提交框在原来代码上没有覆盖,导致两段代码在一起提交上去,出现两个main函数当然PE了。 #include using namespace std;int main(){ int i,t,a,T,sum,fst... 阅读全文
posted @ 2016-06-02 20:11 弃用博客 阅读(205) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;const int N = 10000;int main(){ int T,len,i,j,cnt; char str[N]; cin>>T; while(T--){ cnt... 阅读全文
posted @ 2016-05-30 20:46 弃用博客 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 如图,下面代码 #include #include using namespace std;const int N=10005;int p,q,prime[N],ans[N],num=0;int primePrint(){ int i,j; memset(prime,0,size... 阅读全文
posted @ 2016-05-29 21:19 弃用博客 阅读(136) 评论(0) 推荐(0) 编辑
摘要: # include # include # define IN(x,low,high) ((x)>=(low) && (x) 0) return f[i][j]; f[i][j] = 1; for (k = 0; k h[ni][nj] && f[i][j... 阅读全文
posted @ 2016-05-27 20:50 弃用博客 阅读(111) 评论(0) 推荐(0) 编辑