#929
PunctSegment
Se dau un punct și un segment în plan. Să se verifice dacă punctul se găsește pe segment.
Problema | PunctSegment | Operații I/O |
punctsegment.in /punctsegment.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54252436 | Utilizator | |
Fișier | punctsegment.cpp | Dimensiune | 440 B |
Data încărcării | 23 Noiembrie 2024, 15:12 | Scor / rezultat | Eroare de compilare |
punctsegment.cpp: In function 'int main()': punctsegment.cpp:19:52: error: no match for 'operator-' (operand types are 'int' and 'punct') segment=sqrt((C.x-B.x)*(C.x-B.x)+(C.y-B.y)*(C.y-B.y-B)); ^ punctsegment.cpp:19:52: note: candidates are: 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 punctsegment.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:327:5: note: template<class _Iterator> typename std::reverse_iterator<_Iterator>::difference_type 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:327:5: note: template argument deduction/substitution failed: punctsegment.cpp:19:53: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' segment=sqrt((C.x-B.x)*(C.x-B.x)+(C.y-B.y)*(C.y-B.y-B)); ^ 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 punctsegment.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:379:5: note: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) 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:379:5: note: template argument deduction/substitution failed: punctsegment.cpp:19:53: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' segment=sqrt((C.x-B.x)*(C.x-B.x)+(C.y-B.y)*(C.y-B.y-B)); ^ 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 punctsegment.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:1104:5: note: template<class _IteratorL, class _IteratorR> decltype ((__x.base() - __y.base())) 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:1104:5: note: template argument deduction/substitution failed: punctsegment.cpp:19:53: note: mismatched types 'const std::move_iterator<_Iterator>' and 'int' segment=sqrt((C.x-B.x)*(C.x-B.x)+(C.y-B.y)*(C.y-B.y-B)); ^ 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 punctsegment.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:1111:5: note: template<class _Iterator> decltype ((__x.base() - __y.base())) 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:1111:5: note: template argument deduction/substitution failed: punctsegment.cpp:19:53: note: mismatched types 'const std::move_iterator<_Iterator>' and 'int' segment=sqrt((C.x-B.x)*(C.x-B.x)+(C.y-B.y)*(C.y-B.y-B)); ^ punctsegment.cpp:20:7: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if(C.x<A.x<B.x and C.y<A.y<B.y) ^ punctsegment.cpp:20:23: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if(C.x<A.x<B.x and C.y<A.y<B.y) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PunctSegment 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ă.