2012年5月1日

高精度运算

摘要: #include<stdio.h>#include<string.h>char c[2000];//全局变量,存储大数运算的结果char arr[1000];//高精度除以高精度的余数long z=0;//高精度除以低精度的余数int Judge(char ch[]){//判断字符串ch是否全为,若全为,返回,否则返回 int i,k; k=strlen(ch); for(i=0;i<k;i++) if(ch[i]!='0') return 0; return 1;}int Compare(char a[],char b[]){//比较字符串的大小 阅读全文

posted @ 2012-05-01 16:38 [S*I]SImMon_WCG______* 阅读(737) 评论(0) 推荐(0) 编辑

2012年4月9日

HDU 1548 A strange lift(BFS)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1548玩了两天,差点写不出了。。。。。。。这题是由某个状态遍历其他状态的BFS对于某一状态下有---->所在层:now_floor,从开始到该层按了几次按钮:step。。。。。#include <queue>#include <algorithm>#include <iostream>using namespace std;const int INF = 1 << 30;int a[222];bool vis[222];int n;struct po 阅读全文

posted @ 2012-04-09 18:16 [S*I]SImMon_WCG______* 阅读(340) 评论(0) 推荐(0) 编辑

HDU 2616 Kill the monster(生成排列)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2616#include <queue>#include <algorithm>#include <iostream>using namespace std;const int INF = 1 << 30;struct ka{ int A, M;}a[11];int main(){ int i, j; int ans; int n, init_hp; int p[11]; while (~scanf("%d%d", &n, &am 阅读全文

posted @ 2012-04-09 17:01 [S*I]SImMon_WCG______* 阅读(205) 评论(0) 推荐(0) 编辑

2012年4月6日

HDU 4162 Shape Number(最小表示法)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4162大意:原串通过相邻的数字相减得到的差或8减该差得到一个新串,然后输出新串(看成环)中字典序最小的那个串。。。。这里用到最小表示法:其维护i和j指针,分别指向(共有L(串长)个串)其中2个串(其实只有一个串,拆成2个串好理解点)的串头(注意当比较这两个串的大小的时候i和j都不动,任然指串头,而这个串头是指以该位置开始而得到的串的串头),他是通过k(因为如果不引入k,而i和j是移动的,比较完成后i和j回不了串头)来比较这两个串,即i+k和j+k就是比较这两个串时的指针。。。。。。。然后,当不相等的时候 阅读全文

posted @ 2012-04-06 16:23 [S*I]SImMon_WCG______* 阅读(677) 评论(0) 推荐(0) 编辑

HDU 3374 String Problem(最小(大)表示 + KMP)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=3374他左移的步数刚好是最小(大)表示返回的值+1,然后就是一个关键的结论:同构串个数 == 最小循环节的总个数。。。。#include <iostream>#include <cstring>using namespace std;char p[1000010];int nxt[1000010];//最小表示int Minp(char *c, int l){ int i = 0, j = 1, k = 0, t; while (i < l && j < 阅读全文

posted @ 2012-04-06 15:15 [S*I]SImMon_WCG______* 阅读(155) 评论(0) 推荐(0) 编辑

2012年4月5日

HDU 4027 Can you answer these queries?

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4027大意:先给你n个数。然后m次操作。。1:访问给定区间的和0:把给定区间的每个数都开根号注意一个特点。。。。。。总和最多2^63。。。如果只有1个数。。。。也就最多开7次根号。。。。。即开着开着就恒为1。。。。。。所以,当该区间的和等于区间长度(r-l)+1的时候,该区间的值都不会再更新了。。。通过这题知道:线段树提高效率的关键在于寻找合适的lazy标记,到满足一定条件的时候就不继续更新到点。#include <set>#include <map>#include <l 阅读全文

posted @ 2012-04-05 14:01 [S*I]SImMon_WCG______* 阅读(290) 评论(0) 推荐(0) 编辑

HDU 1572 下沙小面的(2)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1572大意:一点为0,给你m个站,每一步都要经过这些站(如有1,2站。。。可以是0->1->2或0->2->1距离就是累加)。。。。求最小总距离。。。。。这题是生成排列的应用。。。。#include <iostream>#include <algorithm>using namespace std;const int INF = 1<<30;int g[33][33];int a[11], p[11];int main(){ int n, m; 阅读全文

posted @ 2012-04-05 10:18 [S*I]SImMon_WCG______* 阅读(336) 评论(0) 推荐(0) 编辑

2012年4月4日

HDU 1181 变形课

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1181这个输入太坑了。。。。。。。。注意是一进队就就标记vis[]。。。。还有该串挺大的。。。所以数组开大点,不然越界。。。。。#include <iostream>#include <cmath>#include <queue>using namespace std;const int INF = 1<<30;bool vis[11111];int g[55][55];char c[11111];void Bfs(){ int q1 = 1, q2; i 阅读全文

posted @ 2012-04-04 16:50 [S*I]SImMon_WCG______* 阅读(397) 评论(0) 推荐(0) 编辑

HDU 1495 非常可乐

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1495大意:有三个杯子,开始时第一个杯子装满水(体积为a)。。。。倒来倒去,得到其中2个杯里的水的体积都为a/2。。。。求最小次数。。。。不存在就输出NO。。。。从图(以前都是图题)的点转化成状态(这题比较现实化)。。。。struct point//a,b,c是某一状态下三个杯里装的水的体积。。。。v是从开始到该状态倒了多少次。。。。{ int a, b, c, v;};在任意状态下(即每次的队头)。。。。都有6种倒法(即遍历6种)a->b,c。。。b->a,c。。。。c->a,b。。 阅读全文

posted @ 2012-04-04 15:32 [S*I]SImMon_WCG______* 阅读(804) 评论(0) 推荐(0) 编辑

HDU 4206 Treasure Map

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4206大意:给你一个数n,问b^2-a^2 == n,求出满足条件的a 和b,若有多个输出最小的那个,若没,输出IMPOSSIBLEb^2-a^2 = (b-a)*(b+a) =p * q = n因为1<=n<=10^9,现在我们只要枚举p从1到根号10^9,a = (q-p)/2;b = (q+p)/2;其中(q-p)和(q+p)都为偶数,n%p == 0(用于剪枝)然后枚举的时候取最小的a#include <iostream>#include <cmath>usi 阅读全文

posted @ 2012-04-04 13:18 [S*I]SImMon_WCG______* 阅读(307) 评论(0) 推荐(0) 编辑

HDU 1253 胜利大逃亡

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1253大意:能否在规定时间内从(0,0,0)——>(a-1,b-1,c-1)#include <iostream>#include <string>#include <queue>using namespace std;int g[55][55][55];int a, b, c;int xx[6][3] = {{1,0,0}, {0,1,0}, {0,0,1}, {-1,0,0}, {0,-1,0}, {0,0,-1}};struct point{ int i, 阅读全文

posted @ 2012-04-04 11:53 [S*I]SImMon_WCG______* 阅读(226) 评论(0) 推荐(0) 编辑

2012年4月3日

HDU 4198 Quick out of the Harbour(BFS+最小优先队列)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4198大意:起点S到出口的最短花费。。。。。其中#为障碍物。。。。 '.'的花费为1 。。。@的花费为c+1。。。。c是第三个输入数据师兄说过可以dijstra。。。但是我还没试过。。。。留着以后在试吧。#include <iostream>#include <queue>using namespace std;struct point{ int x, y, v; friend bool operator < (point a, point b) { re. 阅读全文

posted @ 2012-04-03 19:18 [S*I]SImMon_WCG______* 阅读(413) 评论(0) 推荐(0) 编辑

HDU 1241 Oil Deposits

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1241大意:计算图中有几大块@#include <iostream>#include <queue>using namespace std;struct point{ int x, y;};char g[111][111];int xx[8] = {1,1,1,0,0,-1,-1,-1};int yy[8] = {1,0,-1,1,-1,1,0,-1};int sum;int n, m;void Bfs(int x, int y)//广搜目的:把该块@全去掉。。{ point q 阅读全文

posted @ 2012-04-03 15:55 [S*I]SImMon_WCG______* 阅读(178) 评论(0) 推荐(0) 编辑

HDU 1372 Knight Moves

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1372大意:给你一个8*8的棋盘,马从起点到终点的最小步数。。。#include <iostream>#include <queue>using namespace std;struct point{ int x, y, v;//v是从始点到该点的步数。};int g[10][10];int xx[8] = {1,1,-1,-1,2,2,-2,-2};int yy[8] = {2,-2,2,-2,1,-1,1,-1};int main(){ int i, j; char a[5] 阅读全文

posted @ 2012-04-03 15:18 [S*I]SImMon_WCG______* 阅读(193) 评论(0) 推荐(0) 编辑

HDU 1312 Red and Black (第一道广搜)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1312大意:从@出发,只能站在不能站在#上。。。。求能踩到的.的个数(包括起始点@)#include <set>#include <map>#include <list>#include <cmath>#include <ctime>#include <deque>#include <queue>#include <stack>#include <cstdio>#include <strin 阅读全文

posted @ 2012-04-03 00:38 [S*I]SImMon_WCG______* 阅读(302) 评论(0) 推荐(0) 编辑

2012年4月1日

HDU 1686 Oulipo

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1686大意:求模式串在主串出现的次数。。(可以重复)#include <iostream>#include <string>using namespace std;const int L1 = 1000010;const int L2 = 10010;char s[L1], p[L2];int nxt[L2], l1, l2;int res;void GetNext(){ int k = -1, j = 0; nxt[0] = -1; while (j < l2) { .. 阅读全文

posted @ 2012-04-01 17:55 [S*I]SImMon_WCG______* 阅读(183) 评论(0) 推荐(0) 编辑

HDU 1711 Number Sequence

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1711把字符数组转成整形数组。。。然后我们本来是从0开始的,,,他要的是从1开始。。。。。#include <iostream>#include <string>using namespace std;const int L1 = 1000010;const int L2 = 10010;int s[L1], p[L2];int nxt[L2], l1, l2;int res;void GetNext(){ int k = -1, j = 0; nxt[0] = -1; whil 阅读全文

posted @ 2012-04-01 17:42 [S*I]SImMon_WCG______* 阅读(188) 评论(0) 推荐(0) 编辑

HDU 2087 剪花布条(第一道KMP题)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2087#include <iostream>#include <string>using namespace std;#define L1 1001#define L2 1001char s[L1], p[L2];int nxt[L2], l1, l2;int res;void GetNext(){ int k = -1, j = 0; nxt[0] = -1; while (j < l2) { if (k == -1 || p[j] == p[k]) ... 阅读全文

posted @ 2012-04-01 16:39 [S*I]SImMon_WCG______* 阅读(178) 评论(0) 推荐(0) 编辑

2012年3月29日

USACO section1.3 Barn Repair 修理牛棚(贪心)

摘要: 题目:http://www.wzoi.org/usaco/11%5C304.asp大意:有m个点,用有数量限制的区间把这些点全部覆盖,求区间和的最小值。贪心原理:如果限制的区间数大于等于m的话ans=m(就因为没考虑这点提交了好多次- -|||);否则,先用把点都排序(这里也忘记了- -|||),用标记法记录相邻点的距离,a[i]表示距离为i的个数。。。每减少一次区间的个数相当于2个区间合并成一个区间,合并的话肯定选距离最小的那个。。。。。把区间个数减到限制的个数为止。。。。。。/*ID: qiufeih1PROG: barn1LANG: C++*/#include <iostream& 阅读全文

posted @ 2012-03-29 22:23 [S*I]SImMon_WCG______* 阅读(873) 评论(0) 推荐(0) 编辑

USACO section1.3 Mixing Milk 混合牛奶

摘要: 题目:http://www.wzoi.org/usaco/11%5C302.asp水题。。。。。。。按价格升序后,从头开始选。/*ID: qiufeih1PROG: milkLANG: C++*/#include <iostream>#include <fstream>#include <cstring>#include <algorithm>using namespace std;const int INF = 1<<30;struct farmer{ int price, num;}a[5010];bool Cmp(farmer 阅读全文

posted @ 2012-03-29 17:12 [S*I]SImMon_WCG______* 阅读(231) 评论(0) 推荐(0) 编辑

USACO section1.2 Milking Cows 挤牛奶(区间覆盖)

摘要: 题目:http://www.wzoi.org/usaco/12%5C211.asp额。。。。纠结了很久。。。。开始没区别时间和时刻。。。。区间是(star,end]都赋值为1/*ID: qiufeih1PROG: milk2LANG: C++*/#include <iostream>#include <fstream>#include <cstring>using namespace std;const int INF = 1<<30;int a[1000001];int main(){ freopen("milk2.in", 阅读全文

posted @ 2012-03-29 12:46 [S*I]SImMon_WCG______* 阅读(423) 评论(0) 推荐(0) 编辑

2012年3月28日

USACO section1.2 Name That Number 命名那个数字

摘要: 题目:http://www.wzoi.org/usaco/11%5C206.asp坑爹的文件输入啊!!!!!!!View Code /*ID: qiufeih1PROG: namenumLANG: C++*/#include <set>#include <map>#include <list>#include <cmath>#include <ctime>#include <deque>#include <queue>#include <stack>#include <cstdio>#i 阅读全文

posted @ 2012-03-28 19:59 [S*I]SImMon_WCG______* 阅读(245) 评论(0) 推荐(0) 编辑

USACO section1.2 Transformations 方块转换

摘要: 题目:http://www.wzoi.org/usaco/13%5C408.aspView Code /*ID: qiufeih1PROG: transformLANG: C++*/#include <set>#include <map>#include <list>#include <cmath>#include <ctime>#include <deque>#include <queue>#include <stack>#include <cstdio>#include <st 阅读全文

posted @ 2012-03-28 19:18 [S*I]SImMon_WCG______* 阅读(210) 评论(0) 推荐(0) 编辑

2012年3月21日

二分法求a^b(递归)

摘要: 原理:b为偶数时,a^b = a^(b/2) * a^(b/2) = (a*a)^(b/2),如a^4 = a^2 * a^2 b为奇数时,a^b = a *a^(b/2) * a^(b/2) =a * (a*a)^(b/2),如a^5 = a *a^2 * a^2 LL A_b(LL a, LL b) { if (b == 0) { return 1; } LL temp = A_b(a*a, b >> 1); if(b & 1) { temp = t... 阅读全文

posted @ 2012-03-21 11:05 [S*I]SImMon_WCG______* 阅读(206) 评论(0) 推荐(0) 编辑

筛选法打表:求某个数的素因子之和

摘要: /****************************************************************/ /*筛选法打表: a[i]表示i的 素因子之和*//****************************************************************/#include <iostream>#include <cstring>using namespace std;int a[100];int m... 阅读全文

posted @ 2012-03-21 10:18 [S*I]SImMon_WCG______* 阅读(337) 评论(0) 推荐(0) 编辑

2012年3月20日

HDU 1969 Pie

摘要: PieTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1105Accepted Submission(s): 365Problem DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various s 阅读全文

posted @ 2012-03-20 20:48 [S*I]SImMon_WCG______* 阅读(786) 评论(0) 推荐(0) 编辑

HDU 2899 Strange fuction

摘要: Strange fuctionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 778Accepted Submission(s): 597Problem DescriptionNow, here is a fuction:F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)Can you find the minimum value when x is between 0 and 1 阅读全文

posted @ 2012-03-20 16:58 [S*I]SImMon_WCG______* 阅读(704) 评论(0) 推荐(0) 编辑

HDU 2199 Can you solve this equation?

摘要: Can you solve this equation?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2091Accepted Submission(s): 1053Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try yo 阅读全文

posted @ 2012-03-20 16:53 [S*I]SImMon_WCG______* 阅读(416) 评论(0) 推荐(0) 编辑

HDU 2112 HDU Today (dijkstar + map)

摘要: HDU TodayTime Limit: 15000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4841Accepted Submission(s): 1156Problem Description经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。这样住了一段时间,徐总对当地的交通还是不 阅读全文

posted @ 2012-03-20 12:25 [S*I]SImMon_WCG______* 阅读(258) 评论(0) 推荐(0) 编辑

HDU 1263 水果 (STL中的map嵌套)

摘要: 水果Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1362Accepted Submission(s): 532Problem Description夏天来了~~好开心啊,呵呵,好多好多水果~~Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了.Input第一行正整数N(0<N<=10)表示有N组测试数据.每组测试数据的第一行是 阅读全文

posted @ 2012-03-20 11:08 [S*I]SImMon_WCG______* 阅读(602) 评论(0) 推荐(0) 编辑

2012年3月19日

#include <cctype>

摘要: c++中应该是#include <cctype>c中应该是#include <ctype.h>以下为字符函数库中常用的函数:函数名称 返回值isalnum() 如果参数是字母数字,即字母或数字,该函数返回trueisalpha() 如果参数是字母,该函数返回真isblank() 如果参数是空格或水平制表符,该函数返回trueiscntrl() 如果参数是控制字符,该函数返回trueisdigit() 如果参数是数字(0~9),该函数返回trueisgraph() 如果参数是除空格之外的打印字符,该函数返回trueislower() 如果参数是小写字母,该函数返回true 阅读全文

posted @ 2012-03-19 22:31 [S*I]SImMon_WCG______* 阅读(297) 评论(0) 推荐(0) 编辑

2012年3月18日

STL中的map

摘要: 一。用数组来插入会覆盖: mapStudent[1] = “student_one”; mapStudent[1] = “student_two”;顺序执行后结果是:mapStudent[1] == “student_two”(覆盖了)。二。我们怎么知道当前已经插入了多少数据呢,可以用size函数三。用count函数来判定关键字(即中括号里的键)是否出现,count函数的返回值只有两个,要么是0,要么是1四。用find函数来定位数据出现位置,它返回的一个迭代器,当数据出现时,它返回数据所在位置的迭代器,如果map中没有要查找的数据,它返回的迭代器等于end函数返回的迭代器View Code # 阅读全文

posted @ 2012-03-18 21:31 [S*I]SImMon_WCG______* 阅读(831) 评论(0) 推荐(0) 编辑

prev_permutation与next_permutation

摘要: int main(){int a[] = {3,1,2};do{ cout << a[0] << " " << a[1] << " " << a[2] << endl;}while (next_permutation(a,a+3));return 0;}输出:312/321 因为原数列不是从最小字典排列开始。所以要想得到所有全排列int a[] = {3,1,2}; change to int a[] = {1,2,3};另外,库中另一函数prev_permutation与next_ 阅读全文

posted @ 2012-03-18 20:48 [S*I]SImMon_WCG______* 阅读(189) 评论(0) 推荐(0) 编辑

2012年3月16日

HDU 1158 Employment Planning (DP)

摘要: Employment PlanningTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2110Accepted Submission(s): 832Problem DescriptionA project manager wants to determine the number of the workers needed in every month. He does know the minimal number of the worker 阅读全文

posted @ 2012-03-16 14:43 [S*I]SImMon_WCG______* 阅读(314) 评论(0) 推荐(0) 编辑

2012年3月15日

HDU 3790 最短路径问题 (双重权值)

摘要: 最短路径问题Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2622Accepted Submission(s): 825Problem Description给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两 阅读全文

posted @ 2012-03-15 18:02 [S*I]SImMon_WCG______* 阅读(4195) 评论(0) 推荐(1) 编辑

2012年3月12日

HDU 2492 Ping pong (树状数组)

摘要: Ping pongTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1567Accepted Submission(s): 554Problem DescriptionN(3<=N<=20000) ping pong players live along a west-east street(consider the street as a line segment).Each player has a unique skill ra 阅读全文

posted @ 2012-03-12 16:21 [S*I]SImMon_WCG______* 阅读(473) 评论(1) 推荐(0) 编辑

HDU 2066 一个人的旅行

摘要: 一个人的旅行Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7413Accepted Submission(s): 2518Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪 阅读全文

posted @ 2012-03-12 12:46 [S*I]SImMon_WCG______* 阅读(239) 评论(0) 推荐(0) 编辑

2012年3月11日

HDU 1233 还是畅通工程 (自己种的第一棵最小生成树)

摘要: 还是畅通工程Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11558Accepted Submission(s): 5293Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用 阅读全文

posted @ 2012-03-11 21:27 [S*I]SImMon_WCG______* 阅读(323) 评论(0) 推荐(0) 编辑

2012年3月10日

HDU 2642 Stars (二维树状数组)

摘要: StarsTime Limit: 5000/2000 MS (Java/Others)Memory Limit: 32768/65536 K (Java/Others)Total Submission(s): 465Accepted Submission(s): 200Problem DescriptionYifenfei is a romantic guy and he likes to count the stars in the sky.To make the problem easier,we considerate the sky is a two-dimension plane.S 阅读全文

posted @ 2012-03-10 17:39 [S*I]SImMon_WCG______* 阅读(384) 评论(0) 推荐(0) 编辑

2012年3月6日

HDU 1874 畅通工程续

摘要: 畅通工程续Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9566Accepted Submission(s): 3200Problem Description某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组 阅读全文

posted @ 2012-03-06 19:09 [S*I]SImMon_WCG______* 阅读(207) 评论(0) 推荐(0) 编辑

导航