#245
NrDivMax
Se dă un număr natural n
. Să se determine numărul din intervalul [1,n]
care are număr maxim de divizori.
Problema | NrDivMax | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53907682 | Utilizator | |
Fișier | nrdivmax.cpp | Dimensiune | 342 B |
Data încărcării | 14 Noiembrie 2024, 13:53 | Scor / rezultat | Eroare de compilare |
nrdivmax.cpp:2:1: error: 'unsing' does not name a type unsing namespace std; ^ nrdivmax.cpp: In function 'int main()': nrdivmax.cpp:5:1: error: 'cin' was not declared in this scope cin >> n; ^ nrdivmax.cpp:5:1: note: suggested alternative: In file included from nrdivmax.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ nrdivmax.cpp:8:1: error: expected primary-expression before ')' token ) ^ nrdivmax.cpp:8:1: error: expected ';' before ')' token nrdivmax.cpp:9:32: error: 'x' was not declared in this scope int nr = 1, d= 2, x = i; while(x>1) { ^ nrdivmax.cpp:12:7: error: 'xxd' was not declared in this scope while(xxd==0) ^ nrdivmax.cpp:13:6: error: 'x' was not declared in this scope i+p, x /= d; ^ nrdivmax.cpp:13:11: error: 'd' was not declared in this scope i+p, x /= d; ^ nrdivmax.cpp:14:1: error: 'nr' was not declared in this scope nr *= p+1; ^ nrdivmax.cpp:15:3: error: 'd' was not declared in this scope ++d; ^ nrdivmax.cpp:16:11: error: 'x' was not declared in this scope if( d*d > x && x > 1 ) ^ nrdivmax.cpp:19:7: error: expected ';' before 'nr' NrMax nr, Max = i; ^ nrdivmax.cpp:19:18: warning: statement has no effect [-Wunused-value] NrMax nr, Max = i; ^ nrdivmax.cpp:20:1: error: 'cout' was not declared in this scope cout << Max; ^ nrdivmax.cpp:20:1: note: suggested alternative: In file included from nrdivmax.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ nrdivmax.cpp:22:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrDivMax 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ă.