#2863
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 | #64016682 | Utilizator | |
| Fișier | pyk.cpp | Dimensiune | 2.33 KB |
| Data încărcării | 06 Aprilie 2026, 15:54 | Scor/rezultat | 100 puncte |
pyk.cpp: In function 'int main()': pyk.cpp:8:20: warning: unused variable 's' [-Wunused-variable] int n, k, y, x,s, c,t,i, j, xmin=10000, xmax=-1,p,d,m=0,nr=0,eg=0, mare=0,pmax=0; ^ pyk.cpp:8:25: warning: unused variable 't' [-Wunused-variable] int n, k, y, x,s, c,t,i, j, xmin=10000, xmax=-1,p,d,m=0,nr=0,eg=0, mare=0,pmax=0; ^ pyk.cpp:8:61: warning: unused variable 'nr' [-Wunused-variable] int n, k, y, x,s, c,t,i, j, xmin=10000, xmax=-1,p,d,m=0,nr=0,eg=0, mare=0,pmax=0; ^ pyk.cpp:8:66: warning: unused variable 'eg' [-Wunused-variable] int n, k, y, x,s, c,t,i, j, xmin=10000, xmax=-1,p,d,m=0,nr=0,eg=0, mare=0,pmax=0; ^ pyk.cpp:8:72: warning: unused variable 'mare' [-Wunused-variable] int n, k, y, x,s, c,t,i, j, xmin=10000, xmax=-1,p,d,m=0,nr=0,eg=0, mare=0,pmax=0; ^ pyk.cpp:8:79: warning: unused variable 'pmax' [-Wunused-variable] int n, k, y, x,s, c,t,i, j, xmin=10000, xmax=-1,p,d,m=0,nr=0,eg=0, mare=0,pmax=0; ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0 secunde | OK. | 1 | 1 | ||
| 1 | 0 secunde | OK. | 4 | 4 | ||
| 2 | 0 secunde | OK. | 1 | 1 | ||
| 3 | 0 secunde | OK. | 4 | 4 | ||
| 4 | 0 secunde | OK. | 1 | 1 | ||
| 5 | 0 secunde | OK. | 4 | 4 | ||
| 6 | 0 secunde | OK. | 1 | 1 | ||
| 7 | 0 secunde | OK. | 4 | 4 | ||
| 8 | 0 secunde | OK. | 1 | 1 | ||
| 9 | 0 secunde | OK. | 4 | 4 | ||
| 10 | 0.004 secunde | OK. | 1 | 1 | ||
| 11 | 0 secunde | OK. | 4 | 4 | ||
| 12 | 0 secunde | OK. | 1 | 1 | ||
| 13 | 0 secunde | OK. | 4 | 4 | ||
| 14 | 0 secunde | OK. | 1 | 1 | ||
| 15 | 0 secunde | OK. | 4 | 4 | ||
| 16 | 0 secunde | OK. | 1 | 1 | ||
| 17 | 0 secunde | OK. | 4 | 4 | ||
| 18 | 0 secunde | OK. | 1 | 1 | ||
| 19 | 0 secunde | OK. | 4 | 4 | ||
| 20 | 0 secunde | OK. | 4 | 4 | ||
| 21 | 0.004 secunde | OK. | 4 | 4 | ||
| 22 | 0.004 secunde | OK. | 4 | 4 | ||
| 23 | 0.004 secunde | OK. | 4 | 4 | ||
| 24 | 0.004 secunde | OK. | 4 | 4 | ||
| 25 | 0.004 secunde | OK. | 5 | 5 | ||
| 26 | 0.008 secunde | OK. | 5 | 5 | ||
| 27 | 0.004 secunde | OK. | 5 | 5 | ||
| 28 | 0.008 secunde | OK. | 5 | 5 | ||
| 29 | 0.008 secunde | OK. | 5 | 5 | ||
| 30 | 0.008 secunde | OK. | 5 | 5 | ||
| Punctaj total | 100 | |||||
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ă.