#1762
Cunoscând latura l a covorului, modelul m ales, procentul p din suprafața inițială a covorului care poate fi decupat, determinați gradul de dantelare al covorului (etapa până la care se poate proceda la modelare), precum și lungimea conturului și suprafața covorului după decupare (perimetrul și aria se vor afișa fiecare prin câte o fracție).
Concursul EMPOWERSOFT, 2016
| Problema | Morum | Operații I/O |
morum.in/morum.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
| Id soluție | #58768711 | Utilizator | |
| Fișier | morum.cpp | Dimensiune | 3.44 KB |
| Data încărcării | 04 August 2025, 20:29 | Scor/rezultat | Eroare de compilare |
morum.cpp:8:14: error: expected type-specifier before '__int128_t' using bint = __int128_t; ^ morum.cpp:11:44: error: 'bint' has not been declared std::ostream& operator<<(std::ostream& os, bint val) { ^ morum.cpp:26:1: error: 'bint' does not name a type bint power(bint base, int exp) { ^ morum.cpp: In function 'void solve_case(long long int, int, int, std::ofstream&)': morum.cpp:35:5: error: 'bint' was not declared in this scope bint l = l_ll; ^ morum.cpp:35:10: error: expected ';' before 'l' bint l = l_ll; ^ morum.cpp:37:10: error: expected ';' before 'limita_procent' bint limita_procent = 100 - p; ^ morum.cpp:40:10: error: expected ';' before 'num_ratio' bint num_ratio = 0, den_ratio = 0; ^ morum.cpp:41:19: error: 'num_ratio' was not declared in this scope if (m == 1) { num_ratio = 3; den_ratio = 4; } ^ morum.cpp:41:34: error: 'den_ratio' was not declared in this scope if (m == 1) { num_ratio = 3; den_ratio = 4; } ^ morum.cpp:42:19: error: 'num_ratio' was not declared in this scope if (m == 2) { num_ratio = 8; den_ratio = 9; } ^ morum.cpp:42:34: error: 'den_ratio' was not declared in this scope if (m == 2) { num_ratio = 8; den_ratio = 9; } ^ morum.cpp:43:19: error: 'num_ratio' was not declared in this scope if (m == 3) { num_ratio = 2; den_ratio = 3; } ^ morum.cpp:43:34: error: 'den_ratio' was not declared in this scope if (m == 3) { num_ratio = 2; den_ratio = 3; } ^ morum.cpp:45:10: error: expected ';' before 'current_num' bint current_num = 1; ^ morum.cpp:46:10: error: expected ';' before 'current_den' bint current_den = 1; ^ morum.cpp:50:19: error: 'current_num' was not declared in this scope if (100 * current_num < limita_procent * current_den) { ^ morum.cpp:50:33: error: 'limita_procent' was not declared in this scope if (100 * current_num < limita_procent * current_den) { ^ morum.cpp:50:50: error: 'current_den' was not declared in this scope if (100 * current_num < limita_procent * current_den) { ^ morum.cpp:55:9: error: 'current_num' was not declared in this scope current_num *= num_ratio; ^ morum.cpp:55:24: error: 'num_ratio' was not declared in this scope current_num *= num_ratio; ^ morum.cpp:56:9: error: 'current_den' was not declared in this scope current_den *= den_ratio; ^ morum.cpp:56:24: error: 'den_ratio' was not declared in this scope current_den *= den_ratio; ^ morum.cpp:60:10: error: ambiguous overload for 'operator<<' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'int') fout << etapa << "\n"; ^ morum.cpp:60:10: note: candidates are: In file included from /usr/include/c++/4.8/iostream:39:0, from morum.cpp:1: /usr/include/c++/4.8/ostream:108:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] <near match> operator<<(__ostream_type& (*__pf)(__ostream_type&)) ^ /usr/include/c++/4.8/ostream:108:7: note: no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&) {aka std::basic_ostream<char>& (*)(std::basic_ostream<char>&)}' /usr/include/c++/4.8/ostream:117:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>] <near match> operator<<(__ios_type& (*__pf)(__ios_type&)) ^ /usr/include/c++/4.8/ostream:117:7: note: no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}' /usr/include/c++/4.8/ostream:127:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] <near match> operator<<(ios_base& (*__pf) (ios_base&)) ^ /usr/include/c++/4.8/ostream:127:7: note: no known conversion for argument 1 from 'int' to 'std::ios_base& (*)(std::ios_base&)' /usr/include/c++/4.8/ostream:166:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(long __n) ^ /usr/include/c++/4.8/ostream:170:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(unsigned long __n) ^ /usr/include/c++/4.8/ostream:174:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(bool __n) ^ In file included from /usr/include/c++/4.8/ostream:612:0, from /usr/include/c++/4.8/iostream:39, from morum.cpp:1: /usr/include/c++/4.8/bits/ostream.tcc:91:5: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>] basic_ostream<_CharT, _Traits>:: ^ In file included from /usr/include/c++/4.8/iostream:39:0, from morum.cpp:1: /usr/include/c++/4.8/ostream:181:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(unsigned short __n) ^ In file included from /usr/include/c++/4.8/ostream:612:0, from /usr/include/c++/4.8/iostream:39, from morum.cpp:1: /usr/include/c++/4.8/bits/ostream.tcc:105:5: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>] basic_ostream<_CharT, _Traits>:: ^ In file included from /usr/include/c++/4.8/iostream:39:0, from morum.cpp:1: /usr/include/c++/4.8/ostream:192:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(unsigned int __n) ^ /usr/include/c++/4.8/ostream:201:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(long long __n) ^ /usr/include/c++/4.8/ostream:205:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(unsigned long long __n) ^ /usr/include/c++/4.8/ostream:220:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(double __f) ^ /usr/include/c++/4.8/ostream:224:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(float __f) ^ /usr/include/c++/4.8/ostream:232:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(long double __f) ^ /usr/include/c++/4.8/ostream:245:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] <near match> operator<<(const void* __p) ^ /usr/include/c++/4.8/ostream:245:7: note: no known conversion for argument 1 from 'int' to 'const void*' In file included from /usr/include/c++/4.8/ostream:612:0, from /usr/include/c++/4.8/iostream:39, from morum.cpp:1: /usr/include/c++/4.8/bits/ostream.tcc:119:5: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>] <near match> basic_ostream<_CharT, _Traits>:: ^ /usr/include/c++/4.8/bits/ostream.tcc:119:5: note: no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}' morum.cpp:11:15: note: std::ostream& operator<<(std::ostream&, int) std::ostream& operator<<(std::ostream& os, bint val) { ^ In file included from /usr/include/c++/4.8/iostream:39:0, from morum.cpp:1: /usr/include/c++/4.8/ostream:602:5: note: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = int] <near match> operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) ^ /usr/include/c++/4.8/ostream:602:5: note: no known conversion for argument 1 from 'std::ofstream {aka std::basic_ofstream<char>}' to 'std::basic_ostream<char>&&' /usr/include/c++/4.8/ostream:493:5: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char) [with _Traits = std::char_traits<char>] operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) ^ /usr/include/c++/4.8/ostream:488:5: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char) [with _Traits = std::char_traits<char>] operator<<(basic_ostream<char, _Traits>& __out, signed char __c) ^ /usr/include/c++/4.8/ostream:482:5: note: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char) [with _Traits = std::char_traits<char>] operator<<(basic_ostream<char, _Traits>& __out, char __c) ^ /usr/include/c++/4.8/ostream:476:5: note: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with _CharT = char; _Traits = std::char_traits<char>] operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) ^ morum.cpp:62:10: error: expected ';' before 'area_num' bint area_num = 0, area_den = 0; ^ morum.cpp:63:10: error: expected ';' before 'perim_num' bint perim_num = 0, perim_den = 0; ^ morum.cpp:67:14: error: expected ';' before 'pow3_E' bint pow3_E = power(3, E); ^ morum.cpp:68:14: error: expected ';' before 'pow4_E' bint pow4_E = power(4, E); ^ morum.cpp:69:9: error: 'area_num' was not declared in this scope area_num = pow3_E * l * l * 173; // A(n) = (3/4)^n * (l^2 * 173/100 / 4) ^ morum.cpp:69:20: error: 'pow3_E' was not declared in this scope area_num = pow3_E * l * l * 173; // A(n) = (3/4)^n * (l^2 * 173/100 / 4) ^ morum.cpp:69:29: error: 'l' was not declared in this scope area_num = pow3_E * l * l * 173; // A(n) = (3/4)^n * (l^2 * 173/100 / 4) ^ morum.cpp:70:9: error: 'area_den' was not declared in this scope area_den = pow4_E * 400; ^ morum.cpp:70:20: error: 'pow4_E' was not declared in this scope area_den = pow4_E * 400; ^ morum.cpp:72:14: error: expected ';' before 'pow3_Ep1' bint pow3_Ep1 = power(3, E + 1); ^ morum.cpp:73:14: error: expected ';' before 'pow2_E' bint pow2_E = power(2, E); ^ morum.cpp:74:9: error: 'perim_num' was not declared in this scope perim_num = pow3_Ep1 * l; // P(n) = 3^(n+1)*l / 2^n ^ morum.cpp:74:21: error: 'pow3_Ep1' was not declared in this scope perim_num = pow3_Ep1 * l; // P(n) = 3^(n+1)*l / 2^n ^ morum.cpp:75:9: error: 'perim_den' was not declared in this scope perim_den = pow2_E; ^ morum.cpp:75:21: error: 'pow2_E' was not declared in this scope perim_den = pow2_E; ^ morum.cpp:78:14: error: expected ';' before 'pow8_E' bint pow8_E = power(8, E); ^ morum.cpp:79:14: error: expected ';' before 'pow9_E' bint pow9_E = power(9, E); ^ morum.cpp:80:9: error: 'area_num' was not declared in this scope area_num = pow8_E * l * l; // A(n) = (8/9)^n * l^2 ^ morum.cpp:80:20: error: 'pow8_E' was not declared in this scope area_num = pow8_E * l * l; // A(n) = (8/9)^n * l^2 ^ morum.cpp:80:29: error: 'l' was not declared in this scope area_num = pow8_E * l * l; // A(n) = (8/9)^n * l^2 ^ morum.cpp:81:9: error: 'area_den' was not declared in this scope area_den = pow9_E; ^ morum.cpp:81:20: error: 'pow9_E' was not declared in this scope area_den = pow9_E; ^ morum.cpp:84:9: error: 'perim_den' was not declared in this scope perim_den = power(3, E); ^ morum.cpp:84:31: error: 'power' was not declared in this scope perim_den = power(3, E); ^ morum.cpp:85:9: error: 'perim_num' was not declared in this scope perim_num = 4 * l * perim_den; // Termenul 4*l adus la numitorul comun ^ morum.cpp:91:14: error: expected ';' before 'pow2_E' bint pow2_E = power(2, E); ^ morum.cpp:92:14: error: expected ';' before 'pow3_E' bint pow3_E = power(3, E); ^ morum.cpp:93:9: error: 'area_num' was not declared in this scope area_num = pow2_E * 3 * l * l * 173; // A(n) = (2/3)^n * (3*l^2*173/100 / 2) ^ morum.cpp:93:20: error: 'pow2_E' was not declared in this scope area_num = pow2_E * 3 * l * l * 173; // A(n) = (2/3)^n * (3*l^2*173/100 / 2) ^ morum.cpp:93:33: error: 'l' was not declared in this scope area_num = pow2_E * 3 * l * l * 173; // A(n) = (2/3)^n * (3*l^2*173/100 / 2) ^ morum.cpp:94:9: error: 'area_den' was not declared in this scope area_den = pow3_E * 200; ^ morum.cpp:94:20: error: 'pow3_E' was not declared in this scope area_den = pow3_E * 200; ^ morum.cpp:96:9: error: 'perim_num' was not declared in this scope perim_num = power(2, E) * 6 * l; // P(n) = 2^n * 6l ^ morum.cpp:96:31: error: 'power' was not declared in this scope perim_num = power(2, E) * 6 * l; // P(n) = 2^n * 6l ^ morum.cpp:97:9: error: 'perim_den' was not declared in this scope perim_den = 1; ^ morum.cpp:100:13: error: 'area_num' was not declared in this scope fout << area_num << "\n"; ^ morum.cpp:101:13: error: 'area_den' was not declared in this scope fout << area_den << "\n"; ^ morum.cpp:102:13: error: 'perim_num' was not declared in this scope fout << perim_num << "\n"; ^ morum.cpp:103:13: error: 'perim_den' was not declared in this scope fout << perim_den << "\n"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Morum 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ă.