ACM
文章平均质量分 81
lengshien
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
选夫婿1
选夫婿1 Time Limit: 1000MS Memory limit: 32768K 题目描述 倾国倾城的大家闺秀潘小姐要选夫婿啦!武林中各门各派,武林外各大户人家,闻讯纷纷前来,强势围观。前来参与竞选的男生藏龙卧虎,高手云集,才子遍布,帅哥纷纭,更不乏富二代,官二代,可谓声势空前。 每个人参与竞选的帅哥除了进行一段激情洋溢的求婚演讲以外,还原创 2015-01-23 22:08:50 · 504 阅读 · 0 评论 -
hdu 1010 Tempter of the Bone(dfs)
dfs入门的一个经典题目原创 2015-08-11 09:04:31 · 343 阅读 · 0 评论 -
bfs模板
#include<cstdio>#include<cstring>#include<queue>#include<algorithm>using namespace std;const int maxn=100;bool vst[maxn][maxn]; // 访问标记int dir[4][2]={0,1,0,-1,1,0,-1,0}; // 方向向量struct State // B原创 2015-08-11 10:28:21 · 419 阅读 · 0 评论 -
dfs模板
DFS:/*该DFS 框架以2D 坐标范围为例,来体现DFS 算法的实现思想。*/#include<cstdio>#include<cstring>#include<cstdlib>using namespace std;const int maxn=100;bool vst[maxn][maxn]; // 访问标记int map[maxn][maxn]; // 坐标范围int原创 2015-08-11 10:29:34 · 591 阅读 · 0 评论 -
素数打表
一种常见的素数打表的方法void init_prime(){ int i, j; for(i = 2;i <= sqrt(1000002.0); ++i) { if(!prime[i]) for(j = i * i; j < 1000002; j += i) prime[j] = 1; } j = 0; for(i = 2;i <= 1000002; ++i)原创 2015-08-20 09:39:13 · 341 阅读 · 0 评论 -
poj 1182 食物链(并查集)
食物链Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 54149 Accepted: 15856Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,原创 2015-09-05 10:16:44 · 336 阅读 · 0 评论 -
uva 572 Oil Deposits(bfs实现)
Oil DepositsTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmitStatusPracticeUVA 572Description The GeoSurvComp geologic survey company is responsible for detecting undergroun原创 2015-08-21 11:25:32 · 508 阅读 · 0 评论 -
CodeForces 550B Preparing Olympiad(dfs暴搜)
B. Preparing Olympiad time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputYou have n problems. You have estimated the difficulty of the原创 2015-08-20 18:49:33 · 444 阅读 · 0 评论 -
hdu 1431 素数回文(打表)
素数回文 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15431 Accepted Submission(s): 3442Problem Description xiaoou33对既是素数又是回文的数特别感兴趣。比如说151原创 2015-08-20 16:53:02 · 627 阅读 · 0 评论 -
hdu 2544 最短路(dijkstra)
最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 42811 Accepted Submission(s): 18764Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很原创 2015-08-18 10:03:11 · 395 阅读 · 0 评论 -
poj 3522 Slim Span(最小生成树)kruskal算法
Slim Span Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 7010 Accepted: 3711DescriptionGiven an undirected weighted graph G, you should find one of spanning trees specified as fo原创 2015-08-15 15:07:22 · 571 阅读 · 0 评论 -
HDU 1272 小希的迷宫(并查集)
小希的迷宫Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35803 Accepted Submission(s): 10932Problem Description上次Gardon的迷宫城堡小希玩了很久(见P原创 2015-08-14 16:50:21 · 445 阅读 · 0 评论 -
zoj 2833 Friendship(并查集)
FriendshipTime Limit: 3 Seconds Memory Limit: 32768 KB A friend is like a flower,a rose to be exact,Or maybe like a brand new gatethat never comes unlatched.A friend i原创 2015-08-13 16:14:11 · 524 阅读 · 0 评论 -
文章标题poj 3278 Catch That Cow(bfs实现)
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 61611 Accepted: 19259DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catc原创 2015-08-11 15:59:10 · 382 阅读 · 0 评论 -
hdu 1312 Red and Black(bfs实现)
Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13414 Accepted Submission(s): 8306Problem Description There is a rectangular原创 2015-08-11 11:48:26 · 381 阅读 · 0 评论 -
HDU - 1312 Red and Black (dfs)
#include"iostream"#include"cstdio"#include"cstring"using namespace std;const int maxn=20+3;int m,n,visit[maxn][maxn];char pic[maxn][maxn];int sum,num;int dic[4][2]={{0,1},{1,0},{0,-1},{-1,0}};原创 2015-08-08 16:26:37 · 307 阅读 · 0 评论 -
UVA - 572 Oil Deposits (dfs)
#include"iostream"#include"cstdio"#include"cstring"using namespace std;const int maxn=100+5;char pic[maxn][maxn];int visit[maxn][maxn];int m,n;void dfs(int r,int l,int num){if(rm||ln) return原创 2015-08-08 13:06:32 · 337 阅读 · 0 评论 -
小泉的难题
小泉的难题Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^题目描述机械实验班有个同学叫小泉,有一天数学老师给小泉布置了一道个人作业,给小泉M(M输入输入包括M+1行,第一行是两个正整数M、N;M表示总共多少组数据,下面M行每行包含N个正整数,每个正整数的值不会超过10^9。(输入数据之间会用空格隔开)原创 2015-01-23 23:40:07 · 818 阅读 · 0 评论 -
hdu 1232 畅通工程(并查集)
畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 38210 Accepted Submission(s): 20269Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条原创 2015-08-13 16:57:25 · 465 阅读 · 0 评论
分享