# Winamax Sponsored Contest (Golf) - Puzzle Discussion

Hi there

I’m trying to solve the Winamax Golf puzzle. The problem statement tells me there is a unique solution to every test case:

Your program must output the unique solution for each course.

Now my program can find multiple solution which I don’t see how contradict winning conditions.

Victory Conditions
You output a solution grid:
All balls land in a hole with at least one hit each.
Arrows do not cross each other.
Arrows do not cross ball or hole locations.
Arrows do not point to a water hazard.
Arrows do not point outside the grid.

Here’s the example of three solutions to test case 7:

Only last one is accepted by the system.
What am I missing?

mr-push

Hey.

It may be this :

“All balls land in a hole with at least one hit each.”

Does it mean the ball has to be with “heath” <= 1 when down in a hole ? (your 1 & 2 scenarios have balls with “heath” > 1)

The number of the ball has a meaning.

I’d say two meanings.

One is obvious; but it took me quite some time to read the problem in full and discover the second one. The one that moved the problem from crazyhard to ohthatwaseasy space.

In the end I think I’ve found it, but rather by trial and error. Still feel like this puzzle is as much of programming as of solving charades. Sigh…

It’s not possible to hit a 4-ball only 1 square away.

Any ball can only be hit N tiles away, and then N-1 tiles, then N-2 tiles etc, until it lands in a hole (where N is it’s initial number).

1 Like

Aaah, that… At last I got it.
This is very subtle rule.

Thank you for clear response.

I also spent a lot of time understanding this rule…

A ball moves across as many cells as its shot count the first time it moves, vertically or horizontally. The next move becomes one shorter, it decreases the number of cells to pass by 1.

This sentence should be reworded to something like:

A ball with a shotcount N will jump by N cells in one direction, vertically or horizontally. The shotcount is then decreased by 1 and the ball can jump again.

4 Likes

Hi. I am having a problem with Test Case 5.

My program outputs:

v<<<<<…
v.>>>>v.
vvv<<<v.
vvv…v.
vvv…<.
vv…
v>>>>…

For:

8 8
.XXX.5X.
X.4.X…X
X4…X3.X
X…X.X.
.X.X.H.X
X.HX…X
X…X.H.X
.XH.XXX.

I checked it, and it feels correct . Any help will be appreciated

EDIT: I was making a stupid mistake. Got 100% now

1 Like

I dont think it is needed to be specified. The fact that the ball jumps over water hazards should be a clue that it would jump over holes too.

Hello,

Did anyone get solution for test case No2?

``````Input
3
3
2.X
..H
.H1
``````

Output which is SUCCESS for them.

``````v..
v..
>.^
``````

It’s obvious that this test case is wrong.

• “2” should be “3”, or
• put water “X” under number 2

Hope Im not alone.

Hi,
I think you are missing this part:
“A ball moves across as many cells as its shot count the first time it moves, vertically or horizontally. The next move becomes one shorter, it decreases the number of cells to pass by 1.”
If it is 3 as you suggest, there will be no space to move.
Water may or may not be present, the only condition is that you do not land in water.

1 Like

2.X
…H
.H1

next:

v.X
v…
1H^

next:

``````v.X
v..
>.^
``````

So the test case is correct. There is no need for the X under the 2.

Actually there are some issues with a later test case, where you got legit alternative solutions but they want you to find their solution … which i find silly.

You may refer to the earlier discussion here.

2 Likes

Hello,
Has anyone finished it yet ?
I just did and I wanted to talk performances.
All my tests are quite fast, except the ninth one (~25 ms)

I’ve got the same issue, solving with python. I think there is an error in this test-case. First line passed to prgoramm is “8 40”, but then only 7 lines are passed. Script waits for one more line.

I’ve tried again later, and my script got the missing line. It seems, the issue is fixed now)

The first line was “8 40” and not “40 8” ? I didn’t notice.
But now, I’ve just run the tests again and :

• Test 9 : 25 ms
• Tests 19-21 : ~1.5 ms
• All the other tests : between 0.003 and 0.1 ms