Detalii evaluare #46674812

Rezumat problemă

#4098 pulsar

Data stelară 3210: Căpitanul navei USS Entrerprise, Jean-Luc Picard se află într-o misiune importantă în cuadrantul Beta al galaxiei. Acesta trebuie să ajungă cât mai rapid de la planeta Vulcan până la planeta Qo’noS, dar din păcate pentru această misiune Jean-Luc Picard nu va putea să ajungă instantaneu la destinație folosind warp drive-ul navei, ci va trebui să se deplaseze în mod normal, din sector în sector. Vouă vă revine rolul de a îl ajuta pe Jean-Luc Picard și să îi răspundeți la una din următoarele întrebări știind harta galaxiei:
- Care este numărul maxim de sectoare ale galaxiei Smax afectate la orice moment de timp de către cel puțin un pulsar.
- Care este timpul minim Tmin de care are nevoie Jean-Luc Picard pentru a ajunge pe planeta Qo’noS.

OJI 2022 clasa a X-a

Detalii

Problema pulsar Operații I/O pulsar.in/pulsar.out
Limita timp 2 secunde Limita memorie Total: 256 MB / Stivă 64 MB
Id soluție #46674812 Utilizator Csillag Szabolcs (csillagszaby)
Fișier pulsar.cpp Dimensiune 3.35 KB
Data încărcării 20 Noiembrie 2023, 15:00 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h: In instantiation of 'constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = Sector]':
/usr/include/c++/4.8/bits/stl_function.h:235:20:   required from 'bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = std::pair<int, Sector>]'
/usr/include/c++/4.8/bits/stl_heap.h:313:40:   required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, Sector>*, std::vector<std::pair<int, Sector>, std::allocator<std::pair<int, Sector> > > >; _Distance = int; _Tp = std::pair<int, Sector>; _Compare = std::less<std::pair<int, Sector> >]'
/usr/include/c++/4.8/bits/stl_heap.h:448:15:   required from 'void std::make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, Sector>*, std::vector<std::pair<int, Sector>, std::allocator<std::pair<int, Sector> > > >; _Compare = std::less<std::pair<int, Sector> >]'
/usr/include/c++/4.8/bits/stl_queue.h:411:48:   required from 'std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, _Sequence&&) [with _Tp = std::pair<int, Sector>; _Sequence = std::vector<std::pair<int, Sector>, std::allocator<std::pair<int, Sector> > >; _Compare = std::less<std::pair<int, Sector> >]'
pulsar.cpp:70:43:   required from here
/usr/include/c++/4.8/bits/stl_pair.h:222:50: error: no match for 'operator<' (operand types are 'const Sector' and 'const Sector')
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note: candidates are:
/usr/include/c++/4.8/bits/stl_pair.h:220:5: note: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^
/usr/include/c++/4.8/bits/stl_pair.h:220:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::pair<_T1, _T2>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:297:5: note: template<class _Iterator> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator<(const reverse_iterator<_Iterator>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:297:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::reverse_iterator<_Iterator>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:347:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator<(const reverse_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:347:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::reverse_iterator<_Iterator>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1055:5: note: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_IteratorR>&)
     operator<(const move_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1055:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::move_iterator<_Iterator>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1061:5: note: template<class _Iterator> bool std::operator<(const std::move_iterator<_Iterator>&, const std::move_iterator<_Iterator>&)
     operator<(const move_iterator<_Iterator>& __x,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1061:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::move_iterator<_Iterator>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/string:52:0,
                 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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2569:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2569:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/string:52:0,
                 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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2581:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2581:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/string:52:0,
                 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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2593:5: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<(const _CharT* __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2593:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   mismatched types 'const _CharT*' and 'Sector'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/vector:64:0,
                 from pulsar.cpp:2:
/usr/include/c++/4.8/bits/stl_vector.h:1421:5: note: template<class _Tp, class _Alloc> bool std::operator<(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)
     operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
     ^
/usr/include/c++/4.8/bits/stl_vector.h:1421:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::vector<_Tp, _Alloc>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/deque:64:0,
                 from /usr/include/c++/4.8/queue:60,
                 from pulsar.cpp:3:
/usr/include/c++/4.8/bits/stl_deque.h:273:5: note: template<class _Tp, class _Ref, class _Ptr> bool std::operator<(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _Ref, _Ptr>&)
     operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
     ^
/usr/include/c++/4.8/bits/stl_deque.h:273:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/deque:64:0,
                 from /usr/include/c++/4.8/queue:60,
                 from pulsar.cpp:3:
/usr/include/c++/4.8/bits/stl_deque.h:281:5: note: template<class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR> bool std::operator<(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _RefR, _PtrR>&)
     operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
     ^
/usr/include/c++/4.8/bits/stl_deque.h:281:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/deque:64:0,
                 from /usr/include/c++/4.8/queue:60,
                 from pulsar.cpp:3:
/usr/include/c++/4.8/bits/stl_deque.h:1975:5: note: template<class _Tp, class _Alloc> bool std::operator<(const std::deque<_Tp, _Alloc>&, const std::deque<_Tp, _Alloc>&)
     operator<(const deque<_Tp, _Alloc>& __x,
     ^
/usr/include/c++/4.8/bits/stl_deque.h:1975:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::deque<_Tp, _Alloc>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/queue:64:0,
                 from pulsar.cpp:3:
/usr/include/c++/4.8/bits/stl_queue.h:286:5: note: template<class _Tp, class _Seq> bool std::operator<(const std::queue<_Tp, _Seq>&, const std::queue<_Tp, _Seq>&)
     operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
     ^
/usr/include/c++/4.8/bits/stl_queue.h:286:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::queue<_Tp, _Seq>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/tuple:39:0,
                 from /usr/include/c++/4.8/functional:55,
                 from /usr/include/c++/4.8/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8/algorithm:62,
                 from pulsar.cpp:4:
/usr/include/c++/4.8/array:238:5: note: template<class _Tp, unsigned int _Nm> bool std::operator<(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)
     operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
     ^
/usr/include/c++/4.8/array:238:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::array<_Tp, _Nm>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
In file included from /usr/include/c++/4.8/functional:55:0,
                 from /usr/include/c++/4.8/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8/algorithm:62,
                 from pulsar.cpp:4:
/usr/include/c++/4.8/tuple:824:5: note: template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&)
     operator<(const tuple<_TElements...>& __t,
     ^
/usr/include/c++/4.8/tuple:824:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from pulsar.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:222:50: note:   'const Sector' is not derived from 'const std::tuple<_Elements ...>'
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                  ^
/usr/include/c++/4.8/bits/stl_pair.h:222:65: error: body of constexpr function 'constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = Sector]' not a return-statement
       || (!(__y.first < __x.first) && __x.second < __y.second); }
                                                                 ^

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