Vox Codei - Puzzle discussion

Is it going to be on the list from single player games?

It already is, in hard category

Bonjour,
Est-il normal que sur ce challenge (et je crois que c’est le seul qui me ça) mon code ne soit pas sauvegardĂ© lorsque je le soumet?
Apres l’avoir soumis, lorsque je retourne sur la page du challenge tout le code a Ă©tĂ© rĂ©initialisĂ©.
J’en Ă©tait a 90% de Vox codei-redux et je suis un peu triste d’avoir perdu 350 lignes de codes ><.
Donc avant de me relancer dans la rĂ©Ă©criture complĂšte je voudrais savoir si j’ai fait une mauvaise manip ou si c’est ce challenge qui a problĂšme (je n’ai observĂ© ça sur aucun autre).

Salut Fred, pas de chance pour toi, cela ne m’est pas arrivĂ©. En gĂ©nĂ©ral, j’utilise un Ă©diteur externe, et je fais un copier-coller afin de ne perdre quoi que ce soit. Peut-ĂȘtre que l’IDE n’a pas retrouvĂ© tes infos de connexions et n’a pas pu associer ton code Ă  ton compte. Est-ce que ta progression a Ă©tĂ© sauvĂ© dans les jeux ? En tout cas, bravo pour ton 90 %, j’en suis pour l’instant Ă  70% sur ce puzzle.

Bah, j’ai parlĂ© trop tĂŽt, j’ai effectivement le mĂȘme comportement, je ne retrouve pas le code de ma derniĂšre soumission. Il s’agit donc bien d’un bug.

Merci pour la réponse, la progression a bien été enregistrée mais les 10 derniers % vont plus long que prévus à atteindre maintenant:(
J’avais justement l’intention de passer par un Ă©diteur externe. Il me reste plus qu’a tout rĂ©Ă©crire, ça me permettra de rĂ©flĂ©chir a mon algo pour rĂ©soudre le dernier test.

So did anyone manage to implement a working solution that pass any tests without a specific mechanism to bypass the last one?

If you still have trouble to find a working algorithm my solution is the following:

Explore every empty and “soon broken” positions to find the place where a bomb will destroy the maximum amount of blocks that are not in the range of another bomb. (What I call a soon broken block is a block in range of a bomb already placed)
Then try to place a bomb at this location (do nothing if you are on a block that is not yet broken).
This solve any freindly test but fail at the last trap test.

To solve the last one, after placing any bomb I count the number of breakable blocks that are “alone” on the map (alone = you can’t place a bomb that will destroy this block and another one, so you need a bomb only for this one).
And if I have less bombs left than the number of alone blocks, I backtrack and I run the algorithm to place a bomb again but I ignore the placements that will destroy the maximal number of blocks, so the new maximum is strictly less than the previous one.

Hope that helped ^^

@Tyra_El: J’ai rencontrĂ© le mĂȘme problĂšme sur un autre puzzle :confused: Je trouve dommage d’avoir Ă  utiliser un IDE externe parceque celui intĂ©grĂ© au site est trĂšs efficace, donc j’espĂšre qu’ils arriveront Ă  rĂ©gler ce problĂšme assez rapidement


3 Likes

Ils ont rĂ©solu le problĂšme, du moins je ne l’ai plus revu. Mais maintenant par sĂ©curitĂ© je fais toujours une sauvegarde de mon code sur mon ordi, ou je code direct sur mon ordi et je transfĂšre sur codingame.

Sinon j’ai fait le mĂȘme algo que toi, Ă  l’exception que je ne cherche pas la position qui dĂ©truit le max de bloc, mais une position qui dĂ©truit au moins la moyenne de bloc Ă  dĂ©truire (donnĂ©e par max(nb-bloc/nb-bombe,nb-bloc/round-3,1)), ce qui Ă©vite d’avoir a reparcourir toute la carte a la recherche d’un nouveau meilleur spot, je prend le premier spot qui n’isole pas de bloc et qui en dĂ©truit suffisamment.

Bein ils ont pas totalement rĂ©solu le problĂšme non : ça m’est arrivĂ© ce midi >_<
Sinon effectivement c’est un bonne optimisation de ma version que tu as là ^^

Solved it with some kind of bruteforce. Another way to describe it would be a greedy algorithm over 2 turns. Greedy on 1 turn will beat everything except the last one. For the last one you need to see 2 turns ahead because the 1 turn ahead max screws you.

5 Likes

Are you talking of the first puzzle (static nodes) or the second one (moving nodes) ?

With the moving nodes, I’m thinking of the same approach but I think this would fail (I didn’t implement it yet). As the nodes can move, maybe at this turn there’s a node “alone” but it (or another one) will move and will not be alone anymore 


It was good fun coding this hard puzzle.
Obviously brute force didn’t pass, finally I found a trick to eliminate a lot of possibilities by going from the maximum of possible destroyed nodes then downwards.
However I don’t think that this would solve any kind of solutions if the number of turns was drastically reduced (turns < bombs + 3)

I actually wrote a really neat and simple Backtracking algorithm. :blush:

My Algorithm passes all the test case except the Destroy CG test case. Somehow its too slow and explores a lot of option.Any help ? I tried optimizing but seems that its not enough.

Btw here is my replay of the last testcase: https://www.codingame.com/replay/solo/71958303

I manage to solve all example test cases, but fail on case 8 and 11 after submitting. It looks like I run out of time. This surprises me, especially for case 11 which looks exactly like the example test case 11 (before submitting) that my program can solve. Anyone experiencing the same problem? Any ideas?

Edit: Never mind. It looks like both cases were on the edge of the allowed time. After little more tuning, I could speed my program up by 10% and now all test cases pass also after submitting.

The animation isn’t working for me anymore, I get a black/gray image with ‘80’ in the bottom right corner and that’s it :frowning:

I tried other puzzles and they were working fine.

Bonjour Tout le monde,

Je vous contacte car j’ai un problùme de pointeur sur ma recherche d’arbre, voici la suite des adresses d’un vector :
0x664af0
0x664ed8
0x6652c0
0x6656a8
0x665a90
0x665e78
0x7ffff7fc4410

Es ce que c’est normal que la taille de l’adresse change de longueur ? Je vous remercie,

0x664af0 = 0x000000664af0 = 0x0000000000664af0 = ...

Tes adresses ne changent pas de taille, mĂȘme si la derniĂšre fait effectivement un bond en avant de mauvais augure pour ton code. :fearful: Difficile toutefois d’en dire plus avec cette simple liste.

speak in english please. how did you print those values? The last one look like vec.end(), a special adress you musn’t go to. (if you’re using C++)

I’ve got this message when I Run my code done in VB.Net :

Informations :
Connecting to firewall.norsefire.gov.uk 
 [OK]
Sortie d’erreur :
4 3


.@



15 1
Stacktrace:
at <0xffffffff>
at VoxCodei/TMap.NextInstruction (int,int) [0x00180] in /tmp/Answer.vb:121
at VoxCodei.Main () [0x001c7] in /tmp/Answer.vb:419
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <IL 0x0004c, 0xffffffff>
Native stacktrace:
Sortie standard :

  • Assertion at method-to-ir.c:3606, condition klass->rank == 0' not met Informations : invalid input. Expected 'x y' but found '* Assertion at method-to-ir.c:3606, conditionklass->rank == 0’ not met’

In Microsoft Visual Studio, I have no problem.
Can someone tell me what to do ?

I have same problem