Dungeon Game-leetcode
Topic:
This is another topic of dynamic planning.The idea at first is to record the maximum number of lives that can be left in the (i,j) position with a two-dimensional array, but this is not true.Then came the idea of another method, starting from the lower right corner, to record the minimum health required in the (I,J) position. Then push toward the beginning.After walking to the last grid, just one drop of blood is needed,
Link: poj 2251
The question is extended from two-dimensional space to three-dimensional space. It can be moved up, down, left, right, and back, and can only be moved to adjacent spaces each time,
It takes at least one minute to start from the start
The activity lasted for 14 days from January 1, March 26 to April 09, 2015. The items are different every day. The following are the prizes for the secret gift box:1. Invitation letter x1002. Dual-bench pocket tank x23. Term title4. Dolls5. Tickets
You can use this map core to make a game of infinite Maze class
Main.cpp
Author:freeknight 2014-09-02 #include "stdafx.h" #include #include #include #include /* Simple logical process Description: Fill the map with the Earth and dig a room
Topic links
poj2251 Topic
Given a three-dimensional map, ' # ' cannot go, '. ' can go to the shortest path to the e of the S to the end. Analysis
The problem is to find the shortest path in the maze, but the maze is three-dimensional, the direction
// 3d maze // standard BFS # include # include # include using namespace STD; struct coordinate {int X, Y, Z, step;}; int L, R, C; bool isvisited [31] [31] [31]; bool place [31] [31] [31]; coordinate goal; coordinate start; int times; void BFS ();
The question is a three-dimensional image, so open a three-dimensional array, and then use bfs to OK!
The following code is used:
#include#include#includeusing namespace std;#define MAXN 31struct node{ int l; int r; int c; int t;
POJ_2251
Compared with the previous problem of traversing the maze of BFS, this question is equivalent to increasing one-dimensional space, so there are two more choices when moving.
#include#includeint a[35][35][35],dis[35][35][35],vis[35][35][35];
It is better than the gourd painting scheme. According to the uva439 idea, we only change the two-dimensional array to three-dimensional, because the calculation of U is so careless that wa is 6 or 7 times, 55555555, And so careless.
# Include #
Title Link: http://poj.org/problem?id=2251
Test instructions: from S to E, if it goes through, output escaped in X minute (s). If not, output "trapped!"
Method: Simple BFS;
#include #include #include #include using namespace std;
Char dun[40][4
Topic Link: http://poj.org/problem?id=2251 topic: This problem is a typical template problem of BFS, but it is interesting that it transforms the graphic from a plane into a three-dimensional graphic, since the difficulty in the input, the use of
= = null){System.Diagnostics.Debug.WriteLine ("Error:worksheet = = null");Return}Worksheet.name = "Test Sheet1"; Name of the worksheetWorksheet.cells.wraptext=true; Set text wrapping for all columnsWorkSheet.Cells.EntireRow.AutoFit (); Set all columns to automatically adjust row height#region Drawing ColumnsCustom methods, drawing columns to sheetRangemark (WorkSheet, "A1", "A2", "Merge vertical column 1");Rangemark (WorkSheet, "B1", "B2", "Merge vertical column 2");Rangemark (WorkSheet, "C1",
model (HMM? To put it bluntly, a mathematical model is represented by a pile of mathematical symbols and parameters, including hidden state sets, observed State sets, initial probability vectors, state transfer matrix A, and confusion matrix B.
A good hmm example on Wiki introduces the basic concepts and problems of HMM easily. The first time you contact hmm, you can take a look at this example. Hmm is introduced in more detail on the hidden Markov models website. Here, we use the examples and
dangerous dungeon. you are informed that the dungeon is going to collapse. you must find the exit stairs within given time. however, you do not want to leave the dungeon empty handed. there are lots of rare jewelsIn the dungeon. try collecting some of them before you leave. some of the jewels are cheaper and some are
Victory (continued)
Time Limit: 4000/2000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)Total submission (s): 5283 accepted submission (s): 1815
Problem descriptionignatius is again taken away by the Devil (I don't know why he is so fond of the devil )......
This time, the devil learned the last lesson, locked Ignatius in an n * M dungeon, installed locks in some places in the dungeon, and hid
Victory (continuous) Time Limit: 2000 msmemory limit: 32768 kbthis problem will be judged on HDU. Original ID: 1429
64-bit integer Io format: % i64d Java class name: Main Ignatius is again taken away by the Devil (I don't know why he liked it )......
This time, the devil learned the last lesson, locked Ignatius in an n * M dungeon, installed locks in some places in the dungeon, and hid the keys in some oth
The Great Escape of victory (continued)Time limit:4000/2000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 7895 Accepted Submission (s): 2795Problem Descriptionignatius again by the Devil was captured (do not understand how he so pleasing to the devil like) ...This time the devil learned from the last lesson, the Ignatius in a N*m dungeon, and in some parts of the dungeon ins
The Great Escape of victory (continued)Time limit:4000/2000 MS (java/others) Memory limit:65536/32768 K (java/others) total submission (s): 7357 Accepted Submission (s): 2552Problem Descriptionignatius again by the Devil was captured (do not understand how he so pleasing to the devil like) ...This time the devil learned from the last lesson, the Ignatius in a N*m dungeon, and in some parts of the dungeon in
Test instructions: This time the devil learned from the last lesson, Ignatius locked in a n*m dungeon, and in some parts of the dungeon with locked doors, keys hidden in other parts of the dungeon. At first the Ignatius was held in (Sx,sy) position, leaving the dungeon door in the (Ex,ey) position. Ignatius can only wa
The Great Escape of victory (continued)Time limit:4000/2000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 6270 Accepted Submission (s): 2177Problem Descriptionignatius again by the Devil was captured (do not understand how he so pleasing to the devil like) ...This time the devil learned from the last lesson, the Ignatius in a N*m dungeon, and in some parts of the dungeon i
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.