#4487
moser
Se consideră un cerc. Pe cerc se desemnează N
puncte oarecare. Dacă tragem linii între toate perechile de puncte, care este numărul maxim de bucăți în care poate fi descompus cercul? Să se răspundă la Q
astfel de scenarii.
Problema | moser | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 128 MB
/
Stivă 8 MB
|
Id soluție | #52465525 | Utilizator | |
Fișier | moser.cpp | Dimensiune | 2.23 KB |
Data încărcării | 30 Septembrie 2024, 22:32 | Scor / rezultat | Eroare de compilare |
moser.cpp:3:1: error: stray '\360' in program 𝑅 ^ moser.cpp:3:1: error: stray '\235' in program moser.cpp:3:1: error: stray '\221' in program moser.cpp:3:1: error: stray '\205' in program moser.cpp:5:1: error: stray '\360' in program 𝑁 ^ moser.cpp:5:1: error: stray '\235' in program moser.cpp:5:1: error: stray '\221' in program moser.cpp:5:1: error: stray '\201' in program moser.cpp:8:1: error: stray '\360' in program 𝑁 ^ moser.cpp:8:1: error: stray '\235' in program moser.cpp:8:1: error: stray '\221' in program moser.cpp:8:1: error: stray '\201' in program moser.cpp:9:1: error: stray '\342' in program N points on a circle looks quite good overall! However, there are a few potential improvements and considerations to ensure correctness and efficiency. Let’s go through your code and see how it can be refined. ^ moser.cpp:9:1: error: stray '\200' in program moser.cpp:9:1: error: stray '\231' in program moser.cpp:15:19: warning: missing terminating ' character [enabled by default] You can use Fermat's Little Theorem to calculate the modular inverses: ^ moser.cpp:15:1: error: missing terminating ' character You can use Fermat's Little Theorem to calculate the modular inverses: ^ moser.cpp:17:1: error: stray '\360' in program 𝑥 ^ moser.cpp:17:1: error: stray '\235' in program moser.cpp:17:1: error: stray '\221' in program moser.cpp:17:1: error: stray '\245' in program moser.cpp:19:1: error: stray '\360' in program 𝑀 ^ moser.cpp:19:1: error: stray '\235' in program moser.cpp:19:1: error: stray '\221' in program moser.cpp:19:1: error: stray '\200' in program moser.cpp:20:1: error: stray '\360' in program 𝑂 ^ moser.cpp:20:1: error: stray '\235' in program moser.cpp:20:1: error: stray '\221' in program moser.cpp:20:1: error: stray '\202' in program moser.cpp:21:1: error: stray '\360' in program 𝐷 ^ moser.cpp:21:1: error: stray '\235' in program moser.cpp:21:1: error: stray '\220' in program moser.cpp:21:1: error: stray '\267' in program moser.cpp:24:1: error: stray '\360' in program 𝑥 ^ moser.cpp:24:1: error: stray '\235' in program moser.cpp:24:1: error: stray '\221' in program moser.cpp:24:1: error: stray '\245' in program moser.cpp:25:1: error: stray '\360' in program 𝑀 ^ moser.cpp:25:1: error: stray '\235' in program moser.cpp:25:1: error: stray '\221' in program moser.cpp:25:1: error: stray '\200' in program moser.cpp:26:1: error: stray '\360' in program 𝑂 ^ moser.cpp:26:1: error: stray '\235' in program moser.cpp:26:1: error: stray '\221' in program moser.cpp:26:1: error: stray '\202' in program moser.cpp:27:1: error: stray '\360' in program 𝐷 ^ moser.cpp:27:1: error: stray '\235' in program moser.cpp:27:1: error: stray '\220' in program moser.cpp:27:1: error: stray '\267' in program moser.cpp:29:1: error: stray '\342' in program − ^ moser.cpp:29:1: error: stray '\210' in program moser.cpp:29:1: error: stray '\222' in program moser.cpp:34:1: error: stray '\342' in program ^ moser.cpp:34:1: error: stray '\200' in program moser.cpp:34:1: error: stray '\211' in program moser.cpp:35:1: error: stray '\342' in program ^ moser.cpp:35:1: error: stray '\200' in program moser.cpp:35:1: error: stray '\211' in program moser.cpp:36:1: error: stray '\360' in program 𝑀 ^ moser.cpp:36:1: error: stray '\235' in program moser.cpp:36:1: error: stray '\221' in program moser.cpp:36:1: error: stray '\200' in program moser.cpp:37:1: error: stray '\360' in program 𝑂 ^ moser.cpp:37:1: error: stray '\235' in program moser.cpp:37:1: error: stray '\221' in program moser.cpp:37:1: error: stray '\202' in program moser.cpp:38:1: error: stray '\360' in program 𝐷 ^ moser.cpp:38:1: error: stray '\235' in program moser.cpp:38:1: error: stray '\220' in program moser.cpp:38:1: error: stray '\267' in program moser.cpp:41:1: error: stray '\342' in program MOD1−2 ^ moser.cpp:41:1: error: stray '\210' in program moser.cpp:41:1: error: stray '\222' in program moser.cpp:49:1: error: stray '\360' in program 𝑁 ^ moser.cpp:49:1: error: stray '\235' in program moser.cpp:49:1: error: stray '\221' in program moser.cpp:49:1: error: stray '\201' in program moser.cpp:53:1: error: stray '\342' in program Here’s an improved version of your solution with these suggestions in mind: ^ moser.cpp:53:1: error: stray '\200' in program moser.cpp:53:1: error: stray '\231' in program moser.cpp:2:1: error: 'Your' does not name a type Your solution for calculating the maximum number of regions ^ moser.cpp: In function 'long long int mod_inverse(long long int)': moser.cpp:64:33: error: no matching function for call to 'pow(long long int&, long long int, const long long int&)' return pow(x, MOD1 - 2, MOD1); ^ moser.cpp:64:33: note: candidates are: In file included from /usr/include/features.h:374:0, from /usr/include/assert.h:35, from /usr/include/c++/4.8/cassert:43, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from moser.cpp:57: /usr/include/i386-linux-gnu/bits/mathcalls.h:153:1: note: double pow(double, double) __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); ^ /usr/include/i386-linux-gnu/bits/mathcalls.h:153:1: note: candidate expects 2 arguments, 3 provided In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from moser.cpp:57: /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::_Pow, std::_Constant, std::_ValArray, _Tp, _Tp>, _Tp> std::pow(const _Tp&, const std::valarray<_Tp>&) _DEFINE_EXPR_BINARY_FUNCTION(pow, _Pow) ^ /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::valarray<_Tp>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from moser.cpp:57: /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::_Pow, std::_ValArray, std::_Constant, _Tp, _Tp>, _Tp> std::pow(const std::valarray<_Tp>&, const _Tp&) _DEFINE_EXPR_BINARY_FUNCTION(pow, _Pow) ^ /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::valarray<_Tp>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from moser.cpp:57: /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::_Pow, std::_ValArray, std::_ValArray, _Tp, _Tp>, _Tp> std::pow(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_EXPR_BINARY_FUNCTION(pow, _Pow) ^ /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::valarray<_Tp>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from moser.cpp:57: /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template<class _Dom> std::_Expr<std::_BinClos<std::_Pow, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::pow(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_FUNCTION(pow, _Pow) ^ /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from moser.cpp:57: /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template<class _Dom> std::_Expr<std::_BinClos<std::_Pow, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::pow(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_FUNCTION(pow, _Pow) ^ /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from moser.cpp:57: /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template<class _Dom> std::_Expr<std::_BinClos<std::_Pow, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::pow(const std::valarray<typename _Dom::valarray>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_FUNCTION(pow, _Pow) ^ /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::valarray<typename _Dom::valarray>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from moser.cpp:57: /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template<class _Dom> std::_Expr<std::_BinClos<std::_Pow, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::pow(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&) _DEFINE_EXPR_BINARY_FUNCTION(pow, _Pow) ^ /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from moser.cpp:57: /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::_Pow, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename _Dom1::value_type> std::pow(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_FUNCTION(pow, _Pow) ^ /usr/include/c++/4.8/bits/valarray_after.h:544:1: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from moser.cpp:57: /usr/include/c++/4.8/complex:1871:5: note: template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const std::complex<_Tp>&, const std::complex<_Up>&) pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y) ^ /usr/include/c++/4.8/complex:1871:5: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::complex<_Tp>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from moser.cpp:57: /usr/include/c++/4.8/complex:1863:5: note: template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const _Tp&, const std::complex<_Up>&) pow(const _Tp& __x, const std::complex<_Up>& __y) ^ /usr/include/c++/4.8/complex:1863:5: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::complex<_Up>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from moser.cpp:57: /usr/include/c++/4.8/complex:1855:5: note: template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const std::complex<_Tp>&, const _Up&) pow(const std::complex<_Tp>& __x, const _Up& __y) ^ /usr/include/c++/4.8/complex:1855:5: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::complex<_Tp>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from moser.cpp:57: /usr/include/c++/4.8/complex:1034:5: note: template<class _Tp> std::complex<_Tp> std::pow(const _Tp&, const std::complex<_Tp>&) pow(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.8/complex:1034:5: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::complex<_Tp>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from moser.cpp:57: /usr/include/c++/4.8/complex:1023:5: note: template<class _Tp> std::complex<_Tp> std::pow(const std::complex<_Tp>&, const std::complex<_Tp>&) pow(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.8/complex:1023:5: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::complex<_Tp>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from moser.cpp:57: /usr/include/c++/4.8/complex:989:5: note: template<class _Tp> std::complex<_Tp> std::pow(const std::complex<_Tp>&, const _Tp&) pow(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.8/complex:989:5: note: template argument deduction/substitution failed: moser.cpp:64:33: note: mismatched types 'const std::complex<_Tp>' and 'long long int' return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:41:0, from moser.cpp:57: /usr/include/c++/4.8/cmath:434:5: note: template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up) pow(_Tp __x, _Up __y) ^ /usr/include/c++/4.8/cmath:434:5: note: template argument deduction/substitution failed: moser.cpp:64:33: note: candidate expects 2 arguments, 3 provided return pow(x, MOD1 - 2, MOD1); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:41:0, from moser.cpp:57: /usr/include/c++/4.8/cmath:411:3: note: constexpr long double std::pow(long double, long double) pow(long double __x, long double __y) ^ /usr/include/c++/4.8/cmath:411:3: note: candidate expects 2 arguments, 3 provided /usr/include/c++/4.8/cmath:407:3: note: constexpr float std::pow(float, float) pow(float __x, float __y) ^ /usr/include/c++/4.8/cmath:407:3: note: candidate expects 2 arguments, 3 provided moser.cpp:65:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema moser 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ă.