#515
SortSD
Se dau n
numere naturale. Afișați aceste numere ordonate crescător după suma divizorilor. Dacă două numere au aceeași sumă a divizorilor, se va afișa mai întâi cel mai mic.
Problema | SortSD | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51748746 | Utilizator | |
Fișier | sortsd.cpp | Dimensiune | 819 B |
Data încărcării | 13 August 2024, 15:01 | Scor / rezultat | Eroare de compilare |
sortsd.cpp: In function 'int main()': sortsd.cpp:18:25: error: no matching function for call to 'div(int&)' divn[i]=div(a[i]); ^ sortsd.cpp:18:25: 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 sortsd.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, 1 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 sortsd.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, 1 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, 1 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortSD 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ă.