ZOJ 1438 Asteroids!--BFS (attention to detail)

Source: Internet
Author: User

Test instructions: Three-bit space with N-layer for shortest circuit

Analysis: It is obvious that the wide search, but also wa many times:

1. Think only 3 layers

2. No special case is discussed: starting point and end point

3. The judgment end condition is placed! X inside

4. The coordinates of the input are changed into X, Y, z after the z,x,y in order to read the question carefully and found that the y,x,z changed the A.

In summary: Still did not seriously read the question understanding test instructions

I hope I won't make these mistakes.

#include <iostream> #include <cstring> #include <cstdio> #include <string> #include <queue >using namespace Std;int N;char a[20][20][20];int d[6][3]={{0,-1,0},{0,1,0},{0,0,-1},{0,0,1},{1,0,0},{-1,0,0}}; String B,c;int sz,sx,sy;int ez,ex,ey;int cnt;struct h{int z,x,y;int t;}; Queue

ZOJ 1438 Asteroids!--BFS (attention to detail)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.