[Community Puzzle] Count as I count

https://www.codingame.com/training/easy/count-as-i-count

Send your feedback or ask for help here!

Created by @Magicien-d-oz,validated by @bbb000bbbyyy.
If you have any issues, feel free to ping them.

You forgot 2 users who validated as well @CommunityBot

They don’t have forum accounts.

TBF, they barely have CG accounts at all: they only solve community puzzles in the exact same language as the puzzle author.

CG’s been notified last time already, but have apparently chosen not to act on it.

3 Likes

Thank you for the gentle reminder.

Indeed, those two accounts are fake accounts. I’ve tried to investigate and understand from which regular account they could come, without result for now.

I’ve removed their moderation rights. The approvals they’ve done can’t be easily undone though.

4 Likes

It seems I misunderstand the calculation logic behind this puzzle as I fail all test below 47.
For me the (bad) solutions are
45 : 38
46 : 17
47 : 7
48 : 3
49 : 1
50 : 1
What is the right solution for 45 and 46? Maybe that would help to see where do I go wrong…
Thanks.

45 -> 40, the rest is correct.

Thanks, this helped a lot. It turned out that my implementation of the “max-4-rounds” rule was faulty.

Hello,
I’ve been stuck on the puzzle Count as I count for two days. I get the good result for tests #1 (47) and #3 (49) but I get wrong results (way too high) as soon as the score to reach is a little high. Can anyone please help me ? I’ve tried to mix loops and recursion and I think I’m on the right path, but I’m not going anywhere with my code. Thank you.

https://pastebin.com/N6Qvw93j

Hi everyone,

my code solve problem till to 39, but when i try to solve 38 I found an incorrect result.
These my permutations:
(follow this rule:
X|Y|Z are the pins fallen (permutations) –
[X,Y+40] is the Y pins fallen altogether (permutations of X,Y+40),
[X+40,Y] is the X pins fallen (permutations of X+40,Y) and so on.
==> (sum of permutations)

1|11 (2) – [1,51] (2) ==> (4)
1|1|10 (3) – [1,1,50] (3) ==> (6)
1|2|9 (6) – [1,42,9] (6),[1,42,49] (6),[1,2,49] (6) ==> (24)
1|3|8 (6) – [1,43,8] (6),[1,43,48] (6),[1,3,48] (6) ==> (24)
1|4|7 (6) – [1,44,7] (6),[1,44,47] (6),[1,4,47] (6) ==> (24)
1|5|6 (6) – [1,45,6] (6),[1,45,46] (6),[1,5,46] (6) ==> (24)
1|1|1|9 (4) – [1,1,1,49] (4) ==> (8)
1|1|2|8 (12) – [1,1,42,8] (12),[1,1,42,48] (12),[1,1,2,48] (12) ==> (48)
1|1|3|7 (12) – [1,1,43,7] (12),[1,1,43,47] (12),[1,1,3,47] (12) ==> (48)
1|1|4|6 (12) – [1,1,44,6] (12),[1,1,44,46] (12),[1,1,4,46] (12) ==> (48)
1|1|5|5 (6) – [1,1,45,5] (12),[1,1,45,45] (6) ==> (24)
1|2|2|7 (12) – [1,42,2,7] (24),[1,42,42,7] (12),[1,42,42,47] (12),[1,2,42,47] (24),[1,2,2,47] (12) ==> (96)
1|2|3|6 (24) – [1,42,3,6] (24),[1,42,43,6] (24),[1,42,43,46] (24),[1,2,43,6] (24),[1,2,43,46] (24),[1,2,3,46] (24) ==> (168)
1|2|4|5 (24) – [1,42,4,5] (24),[1,42,44,5] (24),[1,42,44,45] (24),[1,2,44,5] (24),[1,2,44,45] (24),[1,2,4,45] (24) ==> (168)
1|3|3|5 (12) – [1,43,3,5] (24),[1,43,43,5] (12),[1,43,43,45] (12),[1,3,43,45] (24),[1,3,3,45] (12) ==> (96)
1|3|4|4 (12) – [1,43,4,4] (12),[1,43,44,4] (24),[1,43,44,44] (12),[1,3,44,4] (24),[1,3,44,44] (12) ==> (96)
2|10 (2) – [42,10] (2),[42,50] (2),[2,50] (2) ==> (8)
2|2|8 (3) – [42,2,8] (6),[42,42,8] (3),[42,42,48] (3),[2,42,48] (6),[2,2,48] (3) ==> (24)
2|3|7 (6) – [42,3,7] (6),[42,43,7] (6),[42,43,47] (6),[2,43,7] (6),[2,43,47] (6),[2,3,47] (6) ==> (42)
2|4|6 (6) – [42,4,6] (6),[42,44,6] (6),[42,44,46] (6),[2,44,6] (6),[2,44,46] (6),[2,4,46] (6) ==> (42)
2|5|5 (3) – [42,5,5] (3),[42,45,5] (6),[42,45,45] (3),[2,45,5] (6),[2,45,45] (3) ==> (24)
2|2|2|6 (4) – [42,2,2,6] (12),[42,42,2,6] (12),[42,42,42,6] (4),[42,42,42,46] (4),[2,42,42,46] (12),[2,2,42,46] (12),[2,2,2,46] (4) ==> (64)
2|2|3|5 (12) – [42,2,3,5] (24),[42,42,3,5] (12),[42,42,43,5] (12),[42,42,43,45] (12),[2,42,43,5] (24),[2,42,43,45] (24),[2,2,43,5] (12),[2,2,43,45] (12),[2,2,3,45] (12) ==> (156)
2|2|4|4 (6) – [42,2,4,4] (12),[42,42,4,4] (6),[42,42,44,4] (12),[42,42,44,44] (6),[2,42,44,4] (24),[2,42,44,44] (12),[2,2,44,4] (12),[2,2,44,44] (6) ==> (96)
2|3|3|4 (12) – [42,3,3,4] (12),[42,43,3,4] (24),[42,43,43,4] (12),[42,43,43,44] (12),[2,43,3,4] (24),[2,43,43,4] (12),[2,43,43,44] (12),[2,3,43,44] (24),[2,3,3,44] (12) ==> (156)
3|9 (2) – [43,9] (2),[43,49] (2),[3,49] (2) ==> (8)
3|3|6 (3) – [43,3,6] (6),[43,43,6] (3),[43,43,46] (3),[3,43,46] (6),[3,3,46] (3) ==> (24)
3|4|5 (6) – [43,4,5] (6),[43,44,5] (6),[43,44,45] (6),[3,44,5] (6),[3,44,45] (6),[3,4,45] (6) ==> (42)
3|3|3|3 (1) – [43,3,3,3] (4),[43,43,3,3] (6),[43,43,43,3] (4),[43,43,43,43] (1) ==> (16)
4|8 (2) – [44,8] (2),[44,48] (2),[4,48] (2) ==> (8)
4|4|4 (1) – [44,4,4] (3),[44,44,4] (3),[44,44,44] (1) ==> (8)
5|7 (2) – [45,7] (2),[45,47] (2),[5,47] (2) ==> (8)
6|6 (1) – [46,6] (2),[46,46] (1) ==> (4)
12 (1) – [52] (1) ==> (2)

The total sum is 1638 instead of 1776.

i cannot understand what miss in my solution.

I don’t understand the logic of the exercice. Why in the exemple, it is possible to have “P1 P1 P1” and not “1 1 1”?

1 Like

Because if you have 1 it meen you dropped one pin but if you dropped one pin you need to take the number on it. So you can’t have 1.

I haven’t the slightest idea how to do this one :anguished: