141 - The Spot Game

All about problems in Volume 1. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
titid_gede
Experienced poster
Posts: 187
Joined: Wed Dec 11, 2002 2:03 pm
Location: Mount Papandayan, Garut

141 - The Spot Game

Post by titid_gede »

somebody have sample input, please. i always got WA for this look simple problem
Kalo mau kaya, buat apa sekolah?

hank
Experienced poster
Posts: 146
Joined: Mon Feb 04, 2002 2:00 am
Location: VCORE.

Post by hank »

In this problem....It said:

If the first pattern had been produced earlier, then any of the following three patterns (plus one other not shown) would terminate the game, whereas the last one would not.

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski »

Hint: Did you consider empty board ?

Regards
DM
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)

titid_gede
Experienced poster
Posts: 187
Joined: Wed Dec 11, 2002 2:03 pm
Location: Mount Papandayan, Garut

Post by titid_gede »

got AC now. there is small mistake in my algo, and i also didnt consider an empty board as a pattern. thank you very much. :D :D :D
Kalo mau kaya, buat apa sekolah?

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko »

Ok, I can't read this input, it seems - I checked if input is in the format given, I think it is - I have no idea what I am doing wrong.

I've been getting WA in 0:00.008, which is way faster than other Java submitions, so I suspect it is some kind of a runtime error, but I don't understand what is wrong. Before I post my code, did anyone else have trouble reading this one in?

Darko

P.S. I think it happens after the 8th set - there must be more than 8?

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko »

Here's the worst input, too, hope that helps someone (Draw with 50x50 after 100 moves)

Code: Select all

50
1 1 +
2 2 +
3 3 +
4 4 +
5 5 +
6 6 +
7 7 +
8 8 +
9 9 +
10 10 +
11 11 +
12 12 +
13 13 +
14 14 +
15 15 +
16 16 +
17 17 +
18 18 +
19 19 +
20 20 +
21 21 +
22 22 +
23 23 +
24 24 +
25 25 +
26 26 +
27 27 +
28 28 +
29 29 +
30 30 +
31 31 +
32 32 +
33 33 +
34 34 +
35 35 +
36 36 +
37 37 +
38 38 +
39 39 +
40 40 +
41 41 +
42 42 +
43 43 +
44 44 +
45 45 +
46 46 +
47 47 +
48 48 +
49 49 +
50 50 +
1 2 +
1 1 -
2 2 -
3 3 -
4 4 -
5 5 -
6 6 -
7 7 -
8 8 -
9 9 -
10 10 -
11 11 -
12 12 -
13 13 -
14 14 -
15 15 -
16 16 -
17 17 -
18 18 -
19 19 -
20 20 -
21 21 -
22 22 -
23 23 -
24 24 -
25 25 -
26 26 -
27 27 -
28 28 -
29 29 -
30 30 -
31 31 -
32 32 -
33 33 -
34 34 -
35 35 -
36 36 -
37 37 -
38 38 -
39 39 -
40 40 -
41 41 -
42 42 -
43 43 -
44 44 -
45 45 -
46 46 -
47 47 -
48 48 -
49 49 -
0

My code breaks in case 9 after reading n in this line:

Code: Select all

grid = new byte[4][n][n];
I checked and 0 < n <= 50 (sorry for all those submitions)
In other words - it should be ok there, 10000 bytes is not that much?

Darko

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko »

I changed byte[][][] to int[][][] and it worked. Really slow, but it worked :)

foolishzhu
New poster
Posts: 4
Joined: Sun Jul 02, 2006 5:00 am

Problem 141 WA,need more samples

Post by foolishzhu »

As the title,would some show me more samples of 141?
I've considered empty board.

Joth
New poster
Posts: 11
Joined: Sat Mar 10, 2007 8:29 pm

runtime error (signal 11) on prob 141

Post by Joth »

my code is crashing on 141. can anyone tell me what signal 11 means?
thanks all!

Joth
New poster
Posts: 11
Joined: Sat Mar 10, 2007 8:29 pm

Post by Joth »

ok - i googled it. signal 11 is most likely a memory access error...

mars kaseijin
New poster
Posts: 22
Joined: Mon Sep 19, 2005 4:58 am
Contact:

Post by mars kaseijin »

I have recently completed this problem.
it compiled with error on Judge, but no problems with RH gcc-4.1.1...
:(
Wanna provide me with sample data? Will let you peek at my solution :wink:

mars kaseijin
New poster
Posts: 22
Joined: Mon Sep 19, 2005 4:58 am
Contact:

Post by mars kaseijin »

:o Same here, will need lots of sample data. Including the ones that reduce to an
empty board.

mars kaseijin
New poster
Posts: 22
Joined: Mon Sep 19, 2005 4:58 am
Contact:

Post by mars kaseijin »

Greetings Darko,
my code outputs "Draw" after 50x2 moves.
Do you have more sample data?

Post Reply

Return to “Volume 1 (100-199)”