Detalii evaluare #64455465

Rezumat problemă

Se dau două segmente în plan, specificate prin coordonatele capetelor. Să se verifice dacă au cel puțin un punct comun.

Detalii

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 Nistor Antonio (Light_)
Fișier intersectiesegmente.cpp Dimensiune 2.94 KB
Data încărcării 07 Mai 2026, 19:44 Scor/rezultat Eroare de compilare

Evaluare

Mesaj 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;
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema IntersectieSegmente face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.

Du-te sus!