Feel free to send your feedback or ask some help here!
Take care of the â,â character in input values !
Iâve lost many minutes because my string to float conversion get only the integer part of the coordinates give as input (longitude, latitude).
Faites attention au caractĂšre â,â (virgule) dans les valeurs dâentrĂ©es.
Jâai perdu plusieurs minutes parce que ma conversion de string Ă float ne prenais pas en compte les chiffres aprĂšs la virgule dans les coordonnĂ©es (longitude, latitude) donnĂ©es.
Bon, jâai beau tourner et retourner mon code dans tous les sens je comprends pas : tous les tests dâentrainement sont OK, et tous les tests de validation sont OK Ă part le premier ??? Jâai codĂ© ça en C++, quelquâun dâautre sâest retrouvĂ© dans cette situation ?
Les tests dâentrainement contiennent tous plus dâun dĂ©fibrilateur, le premier test de validation est le seul avec une seule possibilitĂ©. Peut-ĂȘtre que ton algo prend les dĂ©fibrilateurs forcĂ©ment deux par deux ? Quâil doit obligatoirement faire une comparaison avant de sortir un rĂ©sultat ?
Bein non justement, en gros mon algo calcule la distance de lâutilisateur au dĂ©fibrilateur pour chaque dĂ©fibrilateur et garde le minimum en mĂ©moire. A chaque nouveau dĂ©fibrilateur le min est mis Ă jour si besoin (donc on compare jamais 2 Ă©lĂ©ments mais uniquement 1 Ă©lĂ©ment et le min). A la fin du prog on retourne ce min.
Le min est initialisé à -1 et mon test pour mettre à jour le min a un cas particulier qui passe toujours dedans si min == -1.
Peut-ĂȘtre un truc qui se passe mal niveau parsing alors ? Je remarque que dans les tests dâentrainement la solution nâest jamais le dernier. Peut-ĂȘtre que tu ignores le dernier ? (et donc, dans le cas qui foire, le seul, ce qui est balaud XD)
Oh, bien jouĂ©, câĂ©tait bien le problĂšme ^^ Le dernier Ă©lĂ©ment nâĂ©tait jamais lu⊠Et tout ça grĂące Ă la magie du getline(cin, line);
qui gĂ©nĂšre une ligne vide quand on lâappelle aprĂšs une sĂ©rie de cin >> val;
>_< Du coup ma boucle de lecture lisait une ligne vide en premier et ignorait la derniĂšre⊠Merci pour lâaide Lilian ^^
De rien ! Et ouais, cet exo est plein de trucs relous Ă parser, et cin se comporte bizarrement câest facile de se faire avoir^^
Iâm using Double, convesion work good. = )
My code passed all tests in âDefibrillatorsâ, but in final score it says that program havenât passed âComplete file 2â test. Whatâs wrong?
In Java, I needed to convert chars â,â, to â.â. Exp: 34,780 -> 34.780.
I have the same problem as Belinos. Despite having passed all four tests, my code only got 77% completion when it was validated because it allegedly didnât pass âComplete file 2.â What went wrong?
Formula povided for the measurement is too complicated. You can use a much simplier one, since we dont actually need exact distance in kilometers. Triangulation with sqrt((x1-x2)^2+(y1-y2)^2) works fine, no need to overcomplicate it with Earth radius and scalar vector multiplicationâŠ
Aha! I figured that the formula was unnecessarily complicated, but I didnât think it would hurt to use it as is. I was wrong. It turns out that by simplifying the formula, I was able to get 100% validation. Using the complicated formula probably caused a time-out during validation. Thanks for this important clue.
Youâre welcome
Iâve used both the simplified and non-simplified formulae (C++) and have code that passes all the tests, but fails the Exact Position round after I submit, giving me 77%.
Itâd be nice to get an actual error message so I could fix whatever is wrong. Is this available someplace?
Is it possibly something to do with taking too long? (Comma conversion to decimals takes a fair bit of the programâs time. Shouldnât really be significant, but perhaps?)
The Defribillators puzzle is very strange. I donât know why, but passing all the tests doesnât necessarily mean that youâll pass the validation stage.
Since youâre having a problem with the Exact Position test, you might want to try using double variables instead of float. I canât guarantee that it will work, but I think itâs worth a try.
Debugging sure is difficult in here =) Iâm usually using a lot of printErrâs to find out what goes wrong(iâm a JS user).
Aside from that, itâs difficult to say, what have gone wrong in your case without looking at actual code. But iâll try First impression - itâs really matter of accuracy, try to use double, like elysius have already said. Timeout is unlikely, since youâve passed both complete files tests, and they are bigger. And comma conversion doesnât make much of a difference in this scale.
Thank you so much⊠it took quiet a while, until i noticed thisâŠ
Yeah! Thanks for this hint, now I got 100% validation.