感觉自己很水,转眼大三快要毕业了,很无奈,最为一个基本上没怎么碰过acm的人,慌得一皮,尤其夏令营被自己气的睡不着觉,所以最近赶紧刷几波OJ稳定下心境,我想以后无论是考研还是工作都会用到的。
Red and Black
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 13508 Accepted Submission(s): 8375
Problem Description
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can’t move on red tiles, he can move only on black tiles.
Write a program to count the number of black tiles which he can reach by repeating the moves described above.