#2863
pyk
Fie k
, n
și y
trei numere naturale. Fie X
un șir format din n
numere naturale: \( x_1, x_2, x_3, …, x_n \). Fie P
produsul numerelor \( y, x_1, x_2, x_3, …, x_n \), adică \( P = y\times x_1\times x_2 \times x_3 \times … \times x_n \). Numărul P
este o “k-putere” dacă există un număr natural z
astfel încât \( P=z^k \).
Scrieți un program care să citească numerele \( k, n, x_1, x_2, x_3, …, x_n \) și care să determine:
X
ce sunt formate doar din cifre identice;y
(y ≥ 2
) cu proprietatea că numărul \( P = y\times x_1\times x_2 \times x_3 \times … \times x_n \) este o “k-putere”.Problema | pyk | Operații I/O |
pyk.in /pyk.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 8 MB
/
Stivă 8 MB
|
Id soluție | #50689944 | Utilizator | |
Fișier | pyk.cpp | Dimensiune | 1.74 KB |
Data încărcării | 21 Aprilie 2024, 14:13 | Scor / rezultat | Eroare de compilare |
pyk.cpp: In function 'int main()': pyk.cpp:17:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if (x<10) ^ pyk.cpp:43:5: error: 'cout' was not declared in this scope cout<< min << " " << max; ^ pyk.cpp:8:15: warning: unused variable 'y' [-Wunused-variable] int k, n, y, x, max=0, c1, c2, contor1 = 0, contor2 = 0, c, min=10001, copiex, cifra=0, d=2, contor3 = 0, copiex2; ^ pyk.cpp:8:36: warning: unused variable 'contor1' [-Wunused-variable] int k, n, y, x, max=0, c1, c2, contor1 = 0, contor2 = 0, c, min=10001, copiex, cifra=0, d=2, contor3 = 0, copiex2; ^ pyk.cpp:8:49: warning: unused variable 'contor2' [-Wunused-variable] int k, n, y, x, max=0, c1, c2, contor1 = 0, contor2 = 0, c, min=10001, copiex, cifra=0, d=2, contor3 = 0, copiex2; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema pyk 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ă.