2013年7月25日

poj 2115 扩展欧几里德

摘要: 1 #include 2 #include 3 #define max 32 4 5 typedef long long LL; 6 LL pow2[max+5]; 7 8 void init(){ 9 for(int i=1;i<=max;i++){10 pow2[i... 阅读全文

posted @ 2013-07-25 20:03 Stomach_ache 阅读(145) 评论(0) 推荐(0) 编辑

ubuntu查看并杀死进程

摘要: Ubuntu 查看和杀死进程今天在netbeans中关闭webrick时,发现没有关闭掉,打入localhost:3000 依然显示页面,发现无法从nb中再次关闭只有进入ubuntu的进程下关闭查看进程:1,ps -e 命令 2,feng@feng:~$ sudo netstat -antupAct... 阅读全文

posted @ 2013-07-25 16:53 Stomach_ache 阅读(280) 评论(0) 推荐(0) 编辑

USACO 2.1.4

摘要: 1 /* 2 ID: weitong4 3 LANG: C++ 4 TASK: holstein 5 */ 6 #include 7 #include 8 #define v_max 25+5 9 #define g_max 15+510 11 int v,g;12 int a[v_max],b[... 阅读全文

posted @ 2013-07-25 13:50 Stomach_ache 阅读(115) 评论(0) 推荐(0) 编辑

2013年7月22日

freopen() 函数的使用

摘要: 当我们求解acm题目时,通常在设计好算法和程序后,要在调试环境(例如VC等)中运行程序,输入测试数据,当能得到正确运行结果后,才将程序提交到oj中。但由于调试往往不能一次成功,每次运行时,都要重新输入一遍测试数据,对于有大量输入数据的题目,输入数据需要花费大量时间。 使用freope... 阅读全文

posted @ 2013-07-22 19:43 Stomach_ache 阅读(210) 评论(0) 推荐(0) 编辑

2013年7月20日

hdu1520 树形DP

摘要: 1 /* 2 * 树形DP 3 */ 4 #include 5 #include 6 #include 7 using namespace std; 8 #define Max(x,y) (x>y?x:y) 9 #define max 6000+1010 11 //dp[i][0],dp[i]... 阅读全文

posted @ 2013-07-20 13:54 Stomach_ache 阅读(113) 评论(0) 推荐(0) 编辑

2013年7月18日

UVa 10131

摘要: 1 /* 2 3 * 类似于最长递减子序列 4 */ 5 #include 6 7 #include 8 #include 9 using namespace std;10 #define Max(x,y) (x>y?x:y)11 #define max 1000+512 struct nod... 阅读全文

posted @ 2013-07-18 19:43 Stomach_ache 阅读(120) 评论(0) 推荐(0) 编辑

UVa 562

摘要: 1 /* 2 3 * 泥马,WA了一天,这题应该是很简单的DP,不过就是做不出来,只好改用母函数。。。。。 4 */ 5 #include 6 7 #include 8 #include 9 #include10 using namespace std;11 #define max 100+5... 阅读全文

posted @ 2013-07-18 19:42 Stomach_ache 阅读(137) 评论(0) 推荐(0) 编辑

poj2109

摘要: 题目链接: http://poj.org/problem?id=2109代码很简单,但是还是学到了东西。。类型 长度 (bit) 有效数字 绝对值范围float 32 6~7 10^(-37) ~ 10^38double 64 15~16 10^(-307) ~10^308long double ... 阅读全文

posted @ 2013-07-18 12:01 Stomach_ache 阅读(137) 评论(0) 推荐(0) 编辑

2013年7月15日

poj1160 动态规划

摘要: 1 #include 2 #include 3 #define INF 999999999 4 #define Min(x,y) (x<y?x:y) 5 #define max 300+5 6 //dp[i][k]记录在从1到i的村庄中放置k个邮局的最短总距离 7 //sum[i][j]记录在从第... 阅读全文

posted @ 2013-07-15 14:49 Stomach_ache 阅读(126) 评论(0) 推荐(0) 编辑

2013年7月12日

zoj 1001 python起步

摘要: 1 /*赶角还是挺好的。。。。*/2 import sys3 4 for line in sys.stdin:5 a=line.split()6 print int(a[0])+int(a[1]) 阅读全文

posted @ 2013-07-12 21:05 Stomach_ache 阅读(187) 评论(0) 推荐(0) 编辑

导航