#930
Se dau două segmente în plan, specificate prin coordonatele capetelor. Să se verifice dacă au cel puțin un punct comun.
| Problema | IntersectieSegmente | Operații I/O |
intersectiesegmente.in/intersectiesegmente.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64455465 | Utilizator | |
| Fișier | intersectiesegmente.cpp | Dimensiune | 2.94 KB |
| Data încărcării | 07 Mai 2026, 19:44 | Scor/rezultat | Eroare de compilare |
intersectiesegmente.cpp: In function ‘double DistPunctPunct(Point, Point)’: intersectiesegmente.cpp:13:13: error: ‘sqrt’ was not declared in this scope 13 | return (sqrt(((P2.x - P1.x) * (P2.x - P1.x)) + ((P2.y - P1.y) * (P2.y - P1.y)))); | ^~~~ intersectiesegmente.cpp: In function ‘bool SamePoint(Point, Point)’: intersectiesegmente.cpp:17:10: error: ‘fabs’ was not declared in this scope; did you mean ‘labs’? 17 | if ((fabs(P1.x - P2.x) < eps) && (fabs(P1.y - P2.y) < eps)) { | ^~~~ | labs intersectiesegmente.cpp: In function ‘double Slope(Point, Point)’: intersectiesegmente.cpp:31:9: error: ‘fabs’ was not declared in this scope; did you mean ‘labs’? 31 | if (fabs(P2.x - P1.x) < eps) | ^~~~ | labs intersectiesegmente.cpp: In function ‘int Intersectare(Point, Point, Point, Point)’: intersectiesegmente.cpp:48:9: error: ‘fabs’ was not declared in this scope; did you mean ‘labs’? 48 | if (fabs(a1 * b2 - a2 * b1) < eps) { | ^~~~ | labs intersectiesegmente.cpp: In function ‘double DistPunctDreapta(Point, Point, Point)’: intersectiesegmente.cpp:70:12: error: ‘fabs’ was not declared in this scope; did you mean ‘labs’? 70 | return fabs(a * P3.x + b * P3.y + c) / sqrt(a * a + b * b); | ^~~~ | labs intersectiesegmente.cpp:70:44: error: ‘sqrt’ was not declared in this scope 70 | return fabs(a * P3.x + b * P3.y + c) / sqrt(a * a + b * b); | ^~~~ intersectiesegmente.cpp: In function ‘double Slope(Point, Point)’: intersectiesegmente.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type] 35 | } | ^ intersectiesegmente.cpp: In function ‘int Intersectare(Point, Point, Point, Point)’: intersectiesegmente.cpp:46:8: warning: control reaches end of non-void function [-Wreturn-type] 46 | c2 = P3.x * P4.y - P4.x * P3.y; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema IntersectieSegmente 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ă.