#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 | #54289176 | Utilizator | |
| Fișier | pyk.cpp | Dimensiune | 2.57 KB |
| Data încărcării | 24 Noiembrie 2024, 21:56 | Scor/rezultat | Eroare de compilare |
pyk.cpp: In function 'int main()': pyk.cpp:26:26: error: 'INT_MAX' was not declared in this scope int minUniform = INT_MAX, maxUniform = INT_MIN; ^ pyk.cpp:45:17: error: 'maxUniform' was not declared in this scope maxUniform = max(maxUniform, X[i]); ^ pyk.cpp:50:42: error: 'maxUniform' was not declared in this scope fout << minUniform << " " << maxUniform << "\n"; ^ pyk.cpp:75:20: error: expected unqualified-id before '[' token for (auto &[factor, exponent] : factors) { ^ pyk.cpp:75:20: error: expected ';' before '[' token pyk.cpp:75:21: error: 'factor' was not declared in this scope for (auto &[factor, exponent] : factors) { ^ pyk.cpp:75:29: error: 'exponent' was not declared in this scope for (auto &[factor, exponent] : factors) { ^ pyk.cpp: In lambda function: pyk.cpp:75:39: error: expected '{' before ':' token for (auto &[factor, exponent] : factors) { ^ pyk.cpp: In function 'int main()': pyk.cpp:75:39: error: expected ';' before ':' token pyk.cpp:75:39: error: expected primary-expression before ':' token pyk.cpp:75:39: error: expected ')' before ':' token pyk.cpp:75:39: error: expected primary-expression before ':' token pyk.cpp:75:39: error: expected ';' before ':' token pyk.cpp:74:19: warning: unused variable 'y' [-Wunused-variable] long long y = 1; ^ pyk.cpp:108:1: error: expected '}' at end of input } ^ pyk.cpp:108:1: error: expected '}' at end of input
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ă.