上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 42 下一页
摘要: http://www.docin.com/p-540438846.html该定理链接。 1 /* 2 havel-hakimi定理 3 http://www.docin.com/p-540438846.html 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include10 #include11 #include12 #include13 using namespace std;14 typedef long long ll;15 //typedef __int64 int64;16 const int maxn = 24;17 co 阅读全文
posted @ 2013-05-20 21:37 xxx0624 阅读(341) 评论(0) 推荐(0) 编辑
摘要: View Code 1 import java.util.*; 2 import java.math.*; 3 import java.text.*; 4 import java.io.* ; 5 6 public class Main{ 7 public static void main( String args[] ){ 8 BigInteger n,m,tq; 9 Scanner cin = new Scanner(new BufferedInputStream(System.in)); 10 while( cin.hasNex... 阅读全文
posted @ 2013-05-09 20:18 xxx0624 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 和以前的背包方程有点不同。注意:一张支票上可能有多个可能相同的项目这是AC的代码。View Code 1 /* 2 首先dp[i][j]:表示从前i个中选择j个,则转移方程为: 3 dp[i][j] = max( dp[ i-1 ][ j ](不选),dp[ i-1 ][ j-1 ]+val[i](选) ); 4 5 一开始用dp[ i ][ j ]:表示从前i个中选某些个得到不超过j的最大值,发现过不了。。。只好看别人代码。。。 6 */ 7 8 #include<stdio.h> 9 #include<string.h>10 #include<stdlib.h 阅读全文
posted @ 2013-05-09 18:30 xxx0624 阅读(285) 评论(0) 推荐(0) 编辑
摘要: View Code 1 /* 2 dp[ i ]:偷钱i而不被抓的最大概率(因为要使得被抓的概率最小) 3 开始想把dp[i]定义为概率为i的最大价值,因为把i放大了100,不过还是不够。 4 然后看题解才明白要转化,dp[i]:偷i这么多钱的最大不被捕的概率,也就是不被抓的最小概率 5 */ 6 #include<stdio.h> 7 #include<string.h> 8 #include<algorithm> 9 using namespace std;10 const int maxn = 10015;11 double dp[ maxn ];12 阅读全文
posted @ 2013-05-08 19:25 xxx0624 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 带权的并查集View Code 1 /* 2 带权值的并查集 3 ps:对于两个不在同一个集合里面的两个元素,把父节点接在一起即可 4 */ 5 #include<stdio.h> 6 #include<string.h> 7 #include<stdlib.h> 8 #include<algorithm> 9 #include<iostream>10 #include<queue>11 #include<map>12 #include<math.h>13 using namespace std;1 阅读全文
posted @ 2013-05-08 15:25 xxx0624 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 简单题。明白闰年是什么。。View Code 1 /* 2 简单题 3 闰年的判断: 4 year%4==0&&(year%100!=0||year%400==0) 5 */ 6 #include<stdio.h> 7 #include<string.h> 8 #include<stdlib.h> 9 #include<iostream>10 #include<queue>11 #include<stack>12 #include<algorithm>13 #include<map> 阅读全文
posted @ 2013-05-07 18:24 xxx0624 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 安装上ubuntu系统后,第一次登陆该系统后才能设置ubuntu系统的root权限,下面为操作步骤:在终端中输入:venus@venus-laptop:~$ sudo passwd rootEnter new UNIX password: (在这输入你的密码)Retype new UNIX pass... 阅读全文
posted @ 2013-05-07 17:40 xxx0624 阅读(1362) 评论(2) 推荐(0) 编辑
摘要: 虽然题意简单,但是注意的细节还是不少。1、必须满足能刚好付这么多钱。2、尽可能先把1毛的用完3、在2的基础上把5毛的用完4、用10的时候,保证sum是10的倍数,否则先去掉5个1毛,没有1毛再去5毛。。。View Code 1 #include<stdio.h> 2 int main(){ 3 int sum,x1,x5,x10; 4 int a,b,c; 5 while( scanf("%d%d%d%d",&sum,&x1,&x5,&x10)!=EOF && ( sum||x1||x5||x10) ){ 6 a 阅读全文
posted @ 2013-05-05 19:47 xxx0624 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 《转》Know Thy Complexities!Hi there! This webpage covers the space and time Big-O complexities of common algorithms used in Computer Science. When preparing for technical interviews in the past, I found myself spending hours crawling the internet putting together the best, average, and worst case comp 阅读全文
posted @ 2013-05-05 12:53 xxx0624 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 《转》今天发短信问了下,已悲剧。。。最近一个月来微软,腾讯,百度接连倒在技术面的最后一面上,基本上dream公司都过去了,不想说什么了,有点失落。。。直接奉上面经吧,希望都后来人有帮助,百度商务搜索部真的是个很不错的地方,这次没有缘分,希望以后能进。一个月前投的百度商务搜索部实习职位,一直都没有音信,差不多都忘了,结果周一接到电话说让过去面试,好吧,终于轮到我这个备胎了。约了周三过去,下面奉上面经。 十一点到了百度大厦,确实气派,水榭楼台,茂林修竹,而且前台都是帅哥美女。登记后就被面试官带到五楼,一面是一位说话声音很小的小哥,很客气,寒暄之后,开始轰炸。因为投的是检索岗位,就问了一下对搜索引擎 阅读全文
posted @ 2013-05-04 23:48 xxx0624 阅读(269) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 42 下一页