上一页 1 ··· 13 14 15 16 17

P1017 进制转换

摘要: 模拟水题,直接上代码 include using namespace std; const int maxn = 100000; int main() { int n, r; cin n r; int ans[maxn]; int tmp = n; int pos = 0; while(tmp != 阅读全文
posted @ 2016-10-29 16:27 蒟蒻konjac 阅读(182) 评论(0) 推荐(0) 编辑

P1092 虫食算 NOIP2002

摘要: 为了测试stl 30分的暴力写法。。。 include using namespace std; const int maxn = 11; int n; char plus1[maxn], plus2[maxn], answer[maxn]; int ans[maxn]; // bool ok() 阅读全文
posted @ 2016-10-29 15:40 蒟蒻konjac 阅读(148) 评论(0) 推荐(0) 编辑

P1003 铺地毯

摘要: 水题 include using namespace std; const int maxn = 10005; int n; int x, y, i; struct Carp { int a, b, g, k; } cars[maxn]; bool ok() { int left = cars[i] 阅读全文
posted @ 2016-10-29 15:38 蒟蒻konjac 阅读(129) 评论(0) 推荐(0) 编辑

P1443 马的遍历

摘要: 同样是一个bfs水题。。。 不过莫名其妙不知道为什么最后一个点没有过 阅读全文
posted @ 2016-10-29 11:36 蒟蒻konjac 阅读(251) 评论(0) 推荐(0) 编辑

P1032 字串变换

摘要: 最近在练习bfs,看到了02年提高组的这个题,顿时来了兴致,联想到前一阵子的八数码问题,具体就是使用一个字符串来存储状态,把他存储到一个图中,然后开始bfs,如果10步之内无法完成就剪枝,同时使用哈希来优化判重。下面贴上代码。 include using namespace std; const i 阅读全文
posted @ 2016-10-29 08:54 蒟蒻konjac 阅读(225) 评论(0) 推荐(0) 编辑

P1379 八数码问题

摘要: aoapc上的八数码问题,在luogu上也有类似的题,p1379,经典题目,lrj给出了一个算法,同时给出了三种判重的方法。本来想用std::queue改写一下,但是出了各种问题,只好抄代码ac掉这道题了。。。 include using namespace std; typedef int Sta 阅读全文
posted @ 2016-10-29 08:34 蒟蒻konjac 阅读(185) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17