#2558
De când a început serviciul militar, Mihai nu și-a găsit vocația și a decis să-și încerce norocul încă o dată, mergând la superiorul său, Căpitanul Dan. De data aceasta, Dan a fost mai amabil, dar i-a cerut lui Mihai să demonstreze talentul său de trăgător.
Vom considera țintele din zona de tragere ca fiind dreptunghiuri în plan. Căpitanul îi indică lui Mihai câteva puncta pe axa OX și direcțiile de tragere. Fiecare tragere este o semidreaptă care poate fi orientată fie diagonal spre stânga la 45o, fie diagonal spre dreapta la 45o, fie pe verticală în sus. Definim costul atingerii unei ținte ca fiind lungimea intersecției semidreptei de tragere cu dreptunghiul care reprezintă ținta. Dacă intersecția este vidă, sau constă dintr-un singur punct, atunci costul este 0. Definim costul unei trageri ca suma costurilor atingerilor tuturor țintelor. Determinați costul fiecărei trageri.
Balcaniada de Informatică 2018, ziua 1
| Problema | shootings | Operații I/O |
shootings.in/shootings.out
|
|---|---|---|---|
| Limita timp | 0.4 secunde | Limita memorie |
Total: 128 MB
/
Stivă 32 MB
|
| Id soluție | #60950265 | Utilizator | |
| Fișier | shootings.cpp | Dimensiune | 1.80 KB |
| Data încărcării | 16 Noiembrie 2025, 03:26 | Scor/rezultat | 0 puncte |
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0 secunde | Exited with error status 53 | 5 | 0 | ||
| 1 | 0 secunde | Exited with error status 54 | 5 | 0 | ||
| 2 | 0 secunde | Exited with error status 51 | 5 | 0 | ||
| 3 | 0 secunde | Exited with error status 51 | 5 | 0 | ||
| 4 | 0 secunde | Exited with error status 51 | 5 | 0 | ||
| 5 | 0 secunde | Exited with error status 49 | 5 | 0 | ||
| 6 | 0 secunde | Exited with error status 51 | 5 | 0 | ||
| 7 | 0 secunde | Exited with error status 49 | 5 | 0 | ||
| 8 | 0.42 secunde | Exited with error status 52 | 5 | 0 | ||
| 9 | 0.364 secunde | Exited with error status 52 | 5 | 0 | ||
| 10 | 0.004 secunde | Exited with error status 56 | 2 | 0 | ||
| 11 | 0.008 secunde | Exited with error status 57 | 2 | 0 | ||
| 12 | 0.008 secunde | Exited with error status 57 | 3 | 0 | ||
| 13 | 0.004 secunde | Exited with error status 57 | 3 | 0 | ||
| 14 | 0.424 secunde | Exited with error status 52 | 2 | 0 | ||
| 15 | 0.42 secunde | Exited with error status 51 | 2 | 0 | ||
| 16 | 0.404 secunde | Exited with error status 51 | 3 | 0 | ||
| 17 | 0.368 secunde | Exited with error status 52 | 3 | 0 | ||
| 18 | 0.424 secunde | Exited with error status 52 | 2 | 0 | ||
| 19 | 0.424 secunde | Exited with error status 52 | 2 | 0 | ||
| 20 | 0.404 secunde | Exited with error status 52 | 3 | 0 | ||
| 21 | 0.36 secunde | Exited with error status 51 | 3 | 0 | ||
| 22 | 0.424 secunde | Exited with error status 52 | 2 | 0 | ||
| 23 | 0.42 secunde | Exited with error status 51 | 2 | 0 | ||
| 24 | 0.404 secunde | Exited with error status 51 | 3 | 0 | ||
| 25 | 0.364 secunde | Exited with error status 51 | 3 | 0 | ||
| 26 | 0.472 secunde | Exited with error status 52 | 2 | 0 | ||
| 27 | 0.424 secunde | Exited with error status 51 | 2 | 0 | ||
| 28 | 0.404 secunde | Exited with error status 52 | 3 | 0 | ||
| 29 | 0.356 secunde | Exited with error status 51 | 3 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema shootings face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.