#935
PunctInPoligonSimplu
Se dau coordonatele în plan pentru n
puncte care determină un poligon. Se mai dau coordonatele altor m
puncte. Să se verifice, pentru fiecare dintre cele m
puncte, dacă se găsește sau nu în interiorul (sau pe marginea) poligonului.
Problema | PunctInPoligonSimplu | Operații I/O |
punctinpoligonsimplu.in /punctinpoligonsimplu.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53753681 | Utilizator | |
Fișier | punctinpoligonsimplu.cpp | Dimensiune | 2.40 KB |
Data încărcării | 10 Noiembrie 2024, 22:09 | Scor / rezultat | Eroare de compilare |
punctinpoligonsimplu.cpp:26:21: error: no matching function for call to 'std::pair<int, int>::pair(int)' pair<int, int> p(102); ^ punctinpoligonsimplu.cpp:26:21: note: candidates are: 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctinpoligonsimplu.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:206:9: note: template<class ... _Args1, unsigned int ..._Indexes1, class ... _Args2, unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>) pair(tuple<_Args1...>&, tuple<_Args2...>&, ^ /usr/include/c++/4.8/bits/stl_pair.h:206:9: note: template argument deduction/substitution failed: punctinpoligonsimplu.cpp:26:21: note: mismatched types 'std::tuple<_Elements ...>' and 'int' pair<int, int> p(102); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctinpoligonsimplu.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:155:9: note: template<class ... _Args1, class ... _Args2> std::pair<_T1, _T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>, std::tuple<_Args2 ...>) pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>); ^ /usr/include/c++/4.8/bits/stl_pair.h:155:9: note: template argument deduction/substitution failed: punctinpoligonsimplu.cpp:26:21: note: cannot convert '102' (type 'int') to type 'std::piecewise_construct_t' pair<int, int> p(102); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctinpoligonsimplu.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:150:12: note: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) constexpr pair(pair<_U1, _U2>&& __p) ^ /usr/include/c++/4.8/bits/stl_pair.h:150:12: note: template argument deduction/substitution failed: punctinpoligonsimplu.cpp:26:21: note: mismatched types 'std::pair<_T1, _T2>' and 'int' pair<int, int> p(102); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctinpoligonsimplu.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:144:12: note: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) constexpr pair(_U1&& __x, _U2&& __y) ^ /usr/include/c++/4.8/bits/stl_pair.h:144:12: note: template argument deduction/substitution failed: punctinpoligonsimplu.cpp:26:21: note: candidate expects 2 arguments, 1 provided pair<int, int> p(102); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctinpoligonsimplu.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:138:12: note: template<class _U2, class> constexpr std::pair<_T1, _T2>::pair(const _T1&, _U2&&) constexpr pair(const _T1& __x, _U2&& __y) ^ /usr/include/c++/4.8/bits/stl_pair.h:138:12: note: template argument deduction/substitution failed: punctinpoligonsimplu.cpp:26:21: note: candidate expects 2 arguments, 1 provided pair<int, int> p(102); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctinpoligonsimplu.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:133:12: note: template<class _U1, class> constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&) constexpr pair(_U1&& __x, const _T2& __y) ^ /usr/include/c++/4.8/bits/stl_pair.h:133:12: note: template argument deduction/substitution failed: punctinpoligonsimplu.cpp:26:21: note: candidate expects 2 arguments, 1 provided pair<int, int> p(102); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctinpoligonsimplu.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:128:17: note: constexpr std::pair<_T1, _T2>::pair(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int] constexpr pair(pair&&) = default; ^ /usr/include/c++/4.8/bits/stl_pair.h:128:17: note: no known conversion for argument 1 from 'int' to 'std::pair<int, int>&&' /usr/include/c++/4.8/bits/stl_pair.h:127:17: note: constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int] constexpr pair(const pair&) = default; ^ /usr/include/c++/4.8/bits/stl_pair.h:127:17: note: no known conversion for argument 1 from 'int' to 'const std::pair<int, int>&' /usr/include/c++/4.8/bits/stl_pair.h:124:12: note: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) constexpr pair(const pair<_U1, _U2>& __p) ^ /usr/include/c++/4.8/bits/stl_pair.h:124:12: note: template argument deduction/substitution failed: punctinpoligonsimplu.cpp:26:21: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' pair<int, int> p(102); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctinpoligonsimplu.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:112:26: note: constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = int; _T2 = int] _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b) ^ /usr/include/c++/4.8/bits/stl_pair.h:112:26: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_pair.h:108:26: note: constexpr std::pair<_T1, _T2>::pair() [with _T1 = int; _T2 = int] _GLIBCXX_CONSTEXPR pair() ^ /usr/include/c++/4.8/bits/stl_pair.h:108:26: note: candidate expects 0 arguments, 1 provided punctinpoligonsimplu.cpp: In function 'int main()': punctinpoligonsimplu.cpp:30:15: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') fin>>p[i].first>>p[i].second; ^ punctinpoligonsimplu.cpp:30:27: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') fin>>p[i].first>>p[i].second; ^ punctinpoligonsimplu.cpp:32:6: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') p[0] = p[n]; ^ punctinpoligonsimplu.cpp:32:13: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') p[0] = p[n]; ^ punctinpoligonsimplu.cpp:40:32: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') if(punctPeSegment(p[i].first, p[i].second, p[i+1].first, p[i+1].second, X1, Y1)){ ^ punctinpoligonsimplu.cpp:40:44: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') if(punctPeSegment(p[i].first, p[i].second, p[i+1].first, p[i+1].second, X1, Y1)){ ^ punctinpoligonsimplu.cpp:40:57: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') if(punctPeSegment(p[i].first, p[i].second, p[i+1].first, p[i+1].second, X1, Y1)){ ^ punctinpoligonsimplu.cpp:40:71: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') if(punctPeSegment(p[i].first, p[i].second, p[i+1].first, p[i+1].second, X1, Y1)){ ^ punctinpoligonsimplu.cpp:55:23: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') X3 = p[i].first; ^ punctinpoligonsimplu.cpp:56:23: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') Y3 = p[i].second; ^ punctinpoligonsimplu.cpp:57:23: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') X4 = p[i+1].first; ^ punctinpoligonsimplu.cpp:58:23: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int') Y4 = p[i+1].second; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PunctInPoligonSimplu 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ă.