#2319
abc
Se dau două numere naturale nenule a
şi b
, iar produsul lor îl notăm cu c
. Aflaţi cel mai mare divizor propriu al lui A=2
c
-1
.
Problema | abc | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #9740153 | Utilizator | |
Fișier | abc.cpp | Dimensiune | 261 B |
Data încărcării | 28 Mai 2018, 08:44 | Scor / rezultat | Eroare de compilare |
abc.cpp: In function 'int main()': abc.cpp:6:23: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=] std::scanf("%d", a); ^ abc.cpp:7:23: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=] std::scanf("%d", b); ^ abc.cpp:8:19: error: conflicting declaration 'long long int A' long long int A = std::pow(2, a*b)-1; ^ abc.cpp:5:15: error: 'A' has a previous declaration as 'int A' int a, b, A, i; ^ abc.cpp:8:23: error: 'pow' is not a member of 'std' long long int A = std::pow(2, a*b)-1; ^ abc.cpp:9:14: error: 'sqrt' is not a member of 'std' for (i = std::sqrt(A); A % i != 0; --i) ^ abc.cpp:6:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] std::scanf("%d", a); ^ abc.cpp:7:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] std::scanf("%d", b); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema abc 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ă.