2012年12月3日

poj 1426 数字广搜

摘要: 提交了N次,终于过了,原来是忘记N = 0时终止了;真心给跪了,看了很多大神写的代码,感觉不怎么好理解,自己写了一个就是间的广搜 注意剪枝,余数相同时就不再判断了16ms#include<iostream>#include<queue>using namespace std;queue<long long >vi;long long head; long long vis[500],N;void bfs(){ int k = 1; vi.push(k); while(!vi.empty()) { head = vi.front(); vi.pop(); if 阅读全文

posted @ 2012-12-03 21:47 元点之始 阅读(151) 评论(0) 推荐(0) 编辑

hdu 1234 开门人关门人

摘要: 问题不难,关键是看看自己处理字符串的能力了#include<iostream>#include<algorithm>#include<string>//#include<fstream>using namespace std;struct peo{ string name; string first; string last;};int bmp(peo a,peo b){ return a.first < b.first;}int bmp2(peo a,peo b){ return a.last > b.last;}peo str[5 阅读全文

posted @ 2012-12-03 18:53 元点之始 阅读(173) 评论(0) 推荐(0) 编辑

导航