会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
luopengting
勿忘初心,方得始终
导航
博客园
首页
新随笔
联系
订阅
管理
公告
上一页
1
2
3
4
5
6
7
下一页
2014年7月23日
poj 1611 The Suspects
摘要: 并查集 简单题 1 #include 2 #include 3 int par[1000]; 4 int Find(int x) 5 { 6 while(par[x] >= 0) 7 x = par[x]; 8 return x; 9 }10 void Merge(i...
阅读全文
posted @ 2014-07-23 01:06 lpt
阅读(147)
评论(0)
推荐(0)
hdu 1856 More is better
摘要: 并查集 简单题 1 #include 2 #include 3 #include 4 #define N 10000005 5 using namespace std; 6 int par[N]; 7 int M[N]; 8 int Find(int x) 9 {10 if(par[x...
阅读全文
posted @ 2014-07-23 01:04 lpt
阅读(115)
评论(0)
推荐(0)
hdu 1232
摘要: 并查集 入门题 1 #include 2 #include 3 int par[1000]; 4 int Find(int x) 5 { 6 while(par[x] > 0) 7 x = par[x]; 8 return x; 9 }10 void Merge(in...
阅读全文
posted @ 2014-07-23 01:03 lpt
阅读(129)
评论(0)
推荐(0)
UvaOJ 10167
摘要: 暴力搜索 1 #include 2 3 struct node 4 { 5 int x; 6 int y; 7 }s[10000]; 8 int main() 9 {10 //freopen("input.txt","r",stdin);11 int a,b,n,n...
阅读全文
posted @ 2014-07-23 01:01 lpt
阅读(385)
评论(0)
推荐(0)
2014年7月19日
hdu 1226 超级密码
摘要: 超级密码Time Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionIgnatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密...
阅读全文
posted @ 2014-07-19 00:50 lpt
阅读(308)
评论(0)
推荐(0)
2014年7月18日
poj 1129 Channel Allocation
摘要: 可以转化为着色模型dfs + 四色定理 1 #include 2 #include 3 int n,num; 4 int d[100][100]; 5 int c[100]; 6 7 bool ok(int step) 8 { 9 for(int i = 0; i = n) return ...
阅读全文
posted @ 2014-07-18 00:22 lpt
阅读(170)
评论(0)
推荐(0)
2014年7月16日
hdu 1312 Red and Black
摘要: 集训第一场 B题dfs简单题 做完这题就撤,回来再继续做吧= = 水手加油~ 1 #include 2 #include 3 4 int Count; 5 int to[4][2] = {{-1,0},{1,0},{0,1},{0,-1}}; 6 int row,col; 7 char room[...
阅读全文
posted @ 2014-07-16 20:02 lpt
阅读(119)
评论(0)
推荐(0)
hdu 1241 Oil Deposits
摘要: 集训第一场,A题dfs简单题之前看过dfs,没实现过,第一次实现出来O(∩_∩)O~水手加油~ 1 #include 2 #include 3 using namespace std; 4 int row,col; 5 char oil[1000][1000]; 6 int to[8][2]={{-...
阅读全文
posted @ 2014-07-16 20:00 lpt
阅读(101)
评论(0)
推荐(0)
hiho 第二周
摘要: Trie树,第一次写,简单的建树+搜索它的思路hiho上讲得很清楚,good~ 1 #include 2 #include 3 using namespace std; 4 char word[11]; 5 int n,m; 6 struct trie 7 { 8 int num; 9 ...
阅读全文
posted @ 2014-07-16 19:54 lpt
阅读(142)
评论(0)
推荐(0)
2014年6月3日
hdu 1.3.4 shǎ崽 OrOrOrOrz
摘要: 简单的排序,注意输出即可#include #include using namespace std;int main(){ int a[10001]; int n,i; //int t = 0; while(cin>>n) { //if(t)cout>a[...
阅读全文
posted @ 2014-06-03 23:39 lpt
阅读(138)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页