摘要: 题目崔老师推荐,用BFS找路径,然后由于一开始的时候不知道那个打架的时间要费时然后WA了一次,然后当时看见有discuss里说开头可能有怪兽然后又没加优先队列然后又WA了了一次,最后因为优先队列的那个排序错了又WA了一次,一晚上就只做了这一道题。。。悲哀= =。。。View Code 1 #include<stdio.h> 2 #include<string.h> 3 char map[205][205]; 4 struct node 5 { 6 int x,y,step,f;//f存先驱,step是当前的步数。 7 }q[400005]; 8 9 int way... 阅读全文
posted @ 2012-09-06 21:34 某某。 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1102这道题跟那个蛇形矩阵有点相似,主要是找规律,分层,而且看是双层数还是单层数代码:View Code 1 #include <iostream> 2 #include <stdio.h> 3 #include <math.h> 4 using namespace std; 5 6 int main() 7 { 8 long n,i,w, 阅读全文
posted @ 2012-09-06 00:53 某某。 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=99&problem=189&mosmsg=Submission+received+with+ID+10567261这道题跟我们小时候学筛子的时候有关,因为是6面三个颜色所以,直接看1-6,2-5,3-4的颜色搭配是否相同,相当于无向图,看看两个图是否相同就可以了。。注意是无向图哦~View Code 1 #include <stdio.h> 阅读全文
posted @ 2012-09-06 00:51 某某。 阅读(202) 评论(0) 推荐(0) 编辑