Minesweeper

来源:互联网 发布:java开发工程师薪资 编辑:程序博客网 时间:2024/04/26 01:51
Minesweeper is a single player video game. The object is to find out all locations of mines in a field without detonating a mine. The first time I saw it is on windows 98. It is very popular among my classmates and colleagues. I, however, didn't get into it because I didn't want to use my brain when doing something supposed to be fun. My brain is already overloaded after a day of work, so any game involving a lot of thinking is not for me. The minesweeper problem, coming from the game, doesn't ask you to write a decent video game with GUI. Instead it asks you to transform a real field into one that filled with hint numbers.

The description of the problem is at http://acm.uva.es/p/v101/10189.html
I didn't get a verdict of accepted on this easy one until my fourth submission of code. Initially it was my bad that I had forgotten to print colon after "Field #x". When it got fixed, the judge still sent me emails of "wrong answer". After fooling around without any idea of what the problem is, I turned to Google search and it helped. Turned out there're people encounter the same and they solved the problem by removing the last new line. I did as they told and the code was accepted.

I think the judge was being finicky. It should have been able to ignore this minor presentation error and let me off.

Below is the statistics of my submission. I am ranked 5625 among those who have given the correct answer.
I am thinking if anything I have missed that could improve the performance of my code.
10189     5625     9197352     2011-08-27 23:57:46     0.012

Both 3n+1 and minesweeper belong to the category of "ad hoc and simulation". There's not so much algorithmic concept behind. The next one "Trip" looks more like an algorithm problem rather than a programming practice.
原创粉丝点击