#1015
SumVec
Se consideră un șir cu n
elemente, numere naturale. Folosind metoda Divide et Impera, determinați suma elementelor acestui șir.
Problema | SumVec | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55034833 | Utilizator | |
Fișier | sumvec.cpp | Dimensiune | 432 B |
Data încărcării | 17 Decembrie 2024, 17:11 | Scor / rezultat | Eroare de compilare |
sumvec.cpp: In function 'int main()': sumvec.cpp:24:24: error: no matching function for call to 'div(int [1001], int, int&)' cout << div(V, 1, n); ^ sumvec.cpp:24:24: note: candidates are: In file included from /usr/include/c++/4.8/cstdlib:72:0, from /usr/include/c++/4.8/ext/string_conversions.h:41, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, 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 sumvec.cpp:1: /usr/include/stdlib.h:789:14: note: div_t div(int, int) extern div_t div (int __numer, int __denom) ^ /usr/include/stdlib.h:789:14: note: candidate expects 2 arguments, 3 provided In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, 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 sumvec.cpp:1: /usr/include/c++/4.8/cstdlib:214:3: note: lldiv_t __gnu_cxx::div(long long int, long long int) div(long long __n, long long __d) ^ /usr/include/c++/4.8/cstdlib:214:3: note: candidate expects 2 arguments, 3 provided /usr/include/c++/4.8/cstdlib:169:3: note: ldiv_t std::div(long int, long int) div(long __i, long __j) { return ldiv(__i, __j); } ^ /usr/include/c++/4.8/cstdlib:169:3: note: candidate expects 2 arguments, 3 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumVec 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ă.