Detalii evaluare #53480298

Rezumat problemă

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.

Detalii

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 #53480298 Utilizator Galatan Constantin (tucu)
Fișier intersectie_segmente.cpp Dimensiune 2.72 KB
Data încărcării 02 Noiembrie 2024, 05:59 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33:0,
                 from /usr/include/c++/4.8/bits/allocator.h:46,
                 from /usr/include/c++/4.8/string:41,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/fstream:38,
                 from intersectie_segmente.cpp:1:
/usr/include/c++/4.8/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Event; _Args = {int&, int&, int, int}; _Tp = Event]':
/usr/include/c++/4.8/bits/alloc_traits.h:254:4:   required from 'static typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type std::allocator_traits<_Alloc>::_S_construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = Event; _Args = {int&, int&, int, int}; _Alloc = std::allocator<Event>; typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type = void]'
/usr/include/c++/4.8/bits/alloc_traits.h:393:57:   required from 'static decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<_Alloc>::construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = Event; _Args = {int&, int&, int, int}; _Alloc = std::allocator<Event>; decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) = <type error>]'
/usr/include/c++/4.8/bits/vector.tcc:97:40:   required from 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {int&, int&, int, int}; _Tp = Event; _Alloc = std::allocator<Event>]'
intersectie_segmente.cpp:64:36:   required from here
/usr/include/c++/4.8/ext/new_allocator.h:120:4: error: new initializer expression list treated as compound expression [-fpermissive]
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
/usr/include/c++/4.8/ext/new_allocator.h:120:4: error: no matching function for call to 'Event::Event(int)'
/usr/include/c++/4.8/ext/new_allocator.h:120:4: note: candidates are:
intersectie_segmente.cpp:13:8: note: Event::Event()
 struct Event {

        ^
intersectie_segmente.cpp:13:8: note:   candidate expects 0 arguments, 1 provided
intersectie_segmente.cpp:13:8: note: constexpr Event::Event(const Event&)
intersectie_segmente.cpp:13:8: note:   no known conversion for argument 1 from 'int' to 'const Event&'
intersectie_segmente.cpp:13:8: note: constexpr Event::Event(Event&&)
intersectie_segmente.cpp:13:8: note:   no known conversion for argument 1 from 'int' to 'Event&&'
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33:0,
                 from /usr/include/c++/4.8/bits/allocator.h:46,
                 from /usr/include/c++/4.8/string:41,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/fstream:38,
                 from intersectie_segmente.cpp:1:
/usr/include/c++/4.8/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Event; _Args = {int&, int&, int&, int}; _Tp = Event]':
/usr/include/c++/4.8/bits/alloc_traits.h:254:4:   required from 'static typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type std::allocator_traits<_Alloc>::_S_construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = Event; _Args = {int&, int&, int&, int}; _Alloc = std::allocator<Event>; typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type = void]'
/usr/include/c++/4.8/bits/alloc_traits.h:393:57:   required from 'static decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<_Alloc>::construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = Event; _Args = {int&, int&, int&, int}; _Alloc = std::allocator<Event>; decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) = <type error>]'
/usr/include/c++/4.8/bits/vector.tcc:97:40:   required from 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {int&, int&, int&, int}; _Tp = Event; _Alloc = std::allocator<Event>]'
intersectie_segmente.cpp:69:38:   required from here
/usr/include/c++/4.8/ext/new_allocator.h:120:4: error: new initializer expression list treated as compound expression [-fpermissive]
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
/usr/include/c++/4.8/ext/new_allocator.h:120:4: error: no matching function for call to 'Event::Event(int)'
/usr/include/c++/4.8/ext/new_allocator.h:120:4: note: candidates are:
intersectie_segmente.cpp:13:8: note: Event::Event()
 struct Event {

        ^
intersectie_segmente.cpp:13:8: note:   candidate expects 0 arguments, 1 provided
intersectie_segmente.cpp:13:8: note: constexpr Event::Event(const Event&)
intersectie_segmente.cpp:13:8: note:   no known conversion for argument 1 from 'int' to 'const Event&'
intersectie_segmente.cpp:13:8: note: constexpr Event::Event(Event&&)
intersectie_segmente.cpp:13:8: note:   no known conversion for argument 1 from 'int' to 'Event&&'

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