A simple deep-search question, suitable for practice1 // question link: http://poj.org/problem? Id = 2386
2 // solution: Define a lake as 1, define a land as 0, and search for each point by DFS.
3 # include 4 # include 5
6 int map [110] [110], vis [110] [110]; // map the simulated map. vis is used to mark whether the map has been accessed.
7 int dir [8] [2] = {-1, 0}, {-1, 1}, {0, 1}, {1, 1}, {1, 0 },{ 1,-1 },{ 0,-1 },{-1,-1 }}; // eight directions
8
Really is a long time did not come, write blog for me is really difficult to adhere to down, the heat once forget, even if when think up also too lazy to knock a word, this this really do not know how long it can persist, feel it, want to write, do not want to write or reluctantly.Recently due to work debugging need to write a serial tool with a graphical interface, using Python34+pyqt4+pyserial+matplot and other implementations, before in the electronic forum to share, found not many people pla
to collect money. The corresponding names are Bss,boss, payment platform, call center, Bank collection, bank withholding, bank withholding and so on. Such software is not considered financial software.5. It is unlikely that a small amount of money can be cut off by 2 million. ATMs can only fetch tens of thousands of dollars a day, and more than 100,000 will need to make an appointment with the bank. Online Banking and telephone bank transfers are not as high as 2 million. The high degree must b
.51cto.com/2561410/13924336, operation and maintenance of veteran's experience in the workplace Life friends talkhttp://oldboy.blog.51cto.com/2561410/12133097, the actual combat guide students to deal with the idea of failure methods casehttp://oldboy.blog.51cto.com/2561410/9200398, Life is endless, learning more thanoperation, architecture, development has formed the potential of encirclement, advanced development to leave no one!The teacher is waiting for you in the senior architect class (sal
currently executing scene and presses it into the generation execution scenario stack. The incoming scene is then set to the current execution scenario.Popscene: Releases the current scene. Then pops the top of the stack from the generation execution scenario stack. and set it as the current execution scenario. If the stack is empty, the direct endapplication. Used in pairs with pushscene. Able to reach the shape of the main interface into the Setup interface, and then return to the main interf
Direct simulation ... Expand from the lowest to the opposite side = =1 /**************************************************************2 problem:15953 User:rausen4 language:c++5 result:accepted6 time:328 Ms7 memory:3932 KB8 ****************************************************************/9 Ten#include One A using namespacestd; -typedefLong Longll; - Const intN = 1e5 +5; the Constll inf =(ll) 1e18; - -Inlineintread (); - + structData { - ll W, H; + intPre, NXT; A atInlinevoid Get
Starting from any W, the adjacent part is replaced. After one DFS operation, all the WS connected to the initial W will be replaced with '.', so until w no longer exists in the figure, the total number of DFS operations is the answer. Eight statuses are transferred in eight directions. Each grid is called once as a DFS parameter, so the complexity is O (8 × n × m) = O (n × m ).
#include
Poj2386 Lake counting (DFS)
A total of 110 yuan for tickets and tickets, and 100 yuan for travel agencies. I personally feel that there is no need to take a boat, and every door can go in and out to buy a ticket. Of course, there are many people on the north gate, especially at weekends. The sky lake is very small, so it is very crowded, if you like quiet, it is not recommended to come over the weekend! If you eat, the hotels in the scenic area are expensive, and the dishes are
key again, and the virtual opportunity returns to the window mode.VirtualBox is a very powerful feature and it's impossible to learn this blog post alone. Fortunately, it's me. This series has always been adhering to the "give people to fish than to give people to fishing," the principle has been to guide the methodology of the Linux system, and stickers so that no hands-on opportunity of the people also have an intuitive experience of Linux system, also has been pointed out from where to find
to find out which package the KVM kernel module Kvm.ko is provided by, you can look at it with the following command:As you can see, the use of KVM is simple enough to write here. Below, I use KVM to run the WinXP operating system installed in the previous article and experience the efficiency of QEMU's KVM acceleration. Use the following command to run the QEMU with KVM acceleration:As you can see, with KVM acceleration, the WinXP in the virtual machine is running a lot faster and it only took
of the kernel:Yum itself does not download the ability to install the source code package.However, the Yumdownloader tool in the Yum-utils package allows people to download the source code package. The command is yumdownloader--source package-name. The downloaded source code package is the. src.rpm format. You can use the Rpm2cpio command and the cpio command to unpack a source code package if you want to read only the source code instead of recompiling the source code. As follows:After the sou
have repeatedly put the system to hang, one is to change the LIGHTDM configuration file, there is a time to install Gnome-shell, so run the sudo aptitude install Gnome-shell, Not only did the results not Gnome-shell, but even the unity desktop couldn't get in. I would like to remind you children shoes, do not learn from me. If you want to get your hands on the system, it's a good idea to try it in the virtual machine first.With the handy input method is cool Ah, blogging is much faster. The car
takes the ID from the table entity to compare with Unsaved-value, automatically decides to call save or update.The entity object from the table is not added repeatedly as a new entity3. Interestingly, the main table entity associated with the entity object of the table has changed. Originally associated with the customerid=77,Modified to call the Main Table object again customer (original customerid=77, modified to customerid=78,) to display the call to the Save method from the entity object of
water.The idea of memory is that the person who also shoes, m, the position of the current borrow shoes (in which 1 behind), how many people need to borrow shoes, these three can only determine a state, search memory.2, the code is as follows:/** not "memory" can be past, can only be explained that the data is too water. */#includeusing namespacestd;intm, N;intdp[ -][ -][ -];intSolveintIDX, vectorint> Vec,intLeft ) { if(idx = = Vec.size ()-1)return 1; if(Left 0)return 1; if(Dp[m][idx][left]!
from.MySQL optimized "three minus one plus"User centralized access is the Internet in the field of "high incidence", in the face of high concurrency environment, Wu Bingxi teacher proposed: three minus one plus policy. Reduce data access, reduce network traffic, reduce CPU overhead, and increase resources."Military" for efficient index designDesign efficient Indexing
Query, update, delete the Where condition must have an index, the number of rows can not exceed 1w
The index cannot
Original works, allow reprint, reprint, please be sure to hyperlink form to indicate the original source of the article, author information and this statement. Otherwise, legal liability will be held.
For the owners of the settled drops, the drop to the new registered user 50 subsidy, the first use and then send 100, if you let others use can also get 20 yuan. So how long does it take to get an allowance for a ride?
Small series of consulting
Font Display effect test This section is designed to test the display of italicized word, including the English fonts in the song body, "This is english,how does it looks like?". This line is a small print. The following words are bold in the
The reason why I think of writing this, because I am tossing Linux system, there are many times fell into the hard disk partition trap experience. In recent days, once again fell into the pit, tossing two geniuses to climb out of the pit. After the
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.