#3340
perfect1
Se dau n
numere naturale. Să se determine cel mai mare număr perfect mai mic sau egal cu 8128
care poate fi scris ca produs al unora dintre numerele date. Un număr natural este perfect dacă dublul său este egal cu suma divizorilor săi.
Problema | perfect1 | Operații I/O |
![]() perfect1.in /perfect1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51256773 | Utilizator | |
Fișier | perfect1.cpp | Dimensiune | 861 B |
Data încărcării | 02 Iunie 2024, 17:25 | Scor / rezultat | Eroare de compilare |
perfect1.cpp:3:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("perfect1.in"); ^ perfect1.cpp:4:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("perfect1.out"); ^ perfect1.cpp: In function 'void back(int, long long int)': perfect1.cpp:12:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(p <= 8128) ^ perfect1.cpp: In function 'int main()': perfect1.cpp:24:5: error: reference to 'cin' is ambiguous cin >> n; ^ perfect1.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin("perfect1.in"); ^ In file included from perfect1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ perfect1.cpp:27:9: error: reference to 'cin' is ambiguous cin >> x; ^ perfect1.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin("perfect1.in"); ^ In file included from perfect1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ perfect1.cpp:30:27: error: 'sort' was not declared in this scope sort(A + 1 , A + m + 1); ^ perfect1.cpp:31:30: error: 'reverse' was not declared in this scope reverse(A + 1 , A + m + 1); ^ perfect1.cpp:33:17: error: reference to 'cout' is ambiguous if(ok == 0) cout << "NU"; ^ perfect1.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout("perfect1.out"); ^ In file included from perfect1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ perfect1.cpp:34:11: error: reference to 'cout' is ambiguous else cout << maxi; ^ perfect1.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout("perfect1.out"); ^ In file included from perfect1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema perfect1 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ă.