#934
Se dau în plan, un punct și un segment. Să se determine distanța minimă de la punctul dat la un punct aparținând segmentului.
| Problema | DistantaPunctSegment | Operații I/O |
distantapunctsegment.in/distantapunctsegment.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64453775 | Utilizator | |
| Fișier | distantapunctsegment.cpp | Dimensiune | 2.08 KB |
| Data încărcării | 07 Mai 2026, 18:19 | Scor/rezultat | 90 puncte |
distantapunctsegment.cpp: In function ‘double dist_punct_segment(POINT, POINT, POINT)’: distantapunctsegment.cpp:92:1: warning: control reaches end of non-void function [-Wreturn-type] 92 | } | ^ In function ‘double dist_punct_dreapta(POINT, POINT, POINT)’, inlined from ‘double dist_punct_segment(POINT, POINT, POINT)’ at distantapunctsegment.cpp:85:34: distantapunctsegment.cpp:71:18: warning: ‘P0.POINT::x’ may be used uninitialized [-Wmaybe-uninitialized] 71 | return fabs(a*P0.x+b*P0.y+c)/sqrt(a*a+b*b); | ~^~~~~ distantapunctsegment.cpp: In function ‘double dist_punct_segment(POINT, POINT, POINT)’: distantapunctsegment.cpp:76:11: note: ‘P0.POINT::x’ was declared here 76 | POINT P0; | ^~ In function ‘double dist_punct_dreapta(POINT, POINT, POINT)’, inlined from ‘double dist_punct_segment(POINT, POINT, POINT)’ at distantapunctsegment.cpp:85:34: distantapunctsegment.cpp:71:25: warning: ‘P0.POINT::y’ may be used uninitialized [-Wmaybe-uninitialized] 71 | return fabs(a*P0.x+b*P0.y+c)/sqrt(a*a+b*b); | ~^~~~~ distantapunctsegment.cpp: In function ‘double dist_punct_segment(POINT, POINT, POINT)’: distantapunctsegment.cpp:76:11: note: ‘P0.POINT::y’ was declared here 76 | POINT P0; | ^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 10 | 10 | Exemplu | |
| 2 | 0.001 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | OK. | 10 | 10 | ||
| 4 | 0.001 secunde | OK. | 10 | 10 | ||
| 5 | 0.001 secunde | OK. | 10 | 10 | ||
| 6 | 0.001 secunde | OK. | 10 | 10 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| 8 | 0.001 secunde | OK. | 10 | 10 | ||
| 9 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 10 | 0.001 secunde | OK. | 10 | 10 | ||
| Punctaj total | 90 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DistantaPunctSegment 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ă.