#2103
Intersectie Segmente
Se dau N
segmente în plan, fiecare fiind paralel cu una dintre axele de coordonate. Determinați numărul total de puncte de intersecție între două segmente.
Problema | Intersectie Segmente | Operații I/O |
is.in /is.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #8216700 | Utilizator | |
Fișier | intersectie_segmente.cpp | Dimensiune | 1.66 KB |
Data încărcării | 08 Februarie 2018, 11:20 | Scor / rezultat | Eroare de compilare |
intersectie_segmente.cpp:21:28: error: 'int y1' redeclared as different kind of symbol int a[1200000],Sol,n,x1,x2,y1,y2,k,q; ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from intersectie_segmente.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ intersectie_segmente.cpp: In function 'int main()': intersectie_segmente.cpp:65:12: error: cannot bind 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' fin>>x1>>y1>>x2>>y2; ^ In file included from /usr/include/c++/4.8/fstream:38:0, from intersectie_segmente.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = double(double)throw ()]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ intersectie_segmente.cpp:66:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(y1==y2) ^ intersectie_segmente.cpp:69:19: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] v[k].y=y1; ^ intersectie_segmente.cpp:72:19: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] v[k].y=y1; ^ intersectie_segmente.cpp:77:25: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] vert[++q].y1=y1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Intersectie Segmente 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ă.