#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 | #15525429 | Utilizator | |
Fișier | pyk.cpp | Dimensiune | 1.37 KB |
Data încărcării | 19 Aprilie 2019, 15:54 | Scor / rezultat | Eroare de compilare |
pyk.cpp:2:1: error: 'usingnamespace' does not name a type usingnamespace std; ^ pyk.cpp:3:1: error: 'ifstream' does not name a type ifstream fin("http://pyk.in"); ^ pyk.cpp:4:1: error: 'ofstream' does not name a type ofstream fout("pyk.out"); ^ pyk.cpp: In function 'int main()': pyk.cpp:9:5: error: 'fin' was not declared in this scope fin>>c>>k>>n; ^ pyk.cpp:34:13: error: 'fout' was not declared in this scope fout<<1<<endl; ^ pyk.cpp:34:22: error: 'endl' was not declared in this scope fout<<1<<endl; ^ pyk.cpp:34:22: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from pyk.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ pyk.cpp:36:13: error: 'fout' was not declared in this scope fout<<xmin<<" "<<xmax<<endl; ^ pyk.cpp:36:36: error: 'endl' was not declared in this scope fout<<xmin<<" "<<xmax<<endl; ^ pyk.cpp:36:36: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from pyk.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ pyk.cpp:52:17: error: 'maxx' was not declared in this scope maxx=d; ^ pyk.cpp:55:21: error: 'maxx' was not declared in this scope for(i=2; i<=maxx; i++) ^ pyk.cpp:58:17: error: 'm' was not declared in this scope m++; ^ pyk.cpp:61:9: error: 'fout' was not declared in this scope fout<<m; ^ pyk.cpp:61:15: error: 'm' was not declared in this scope fout<<m; ^ pyk.cpp:63:44: error: 'endl' was not declared in this scope fout<<w[i]<<" "<<k-gr[w[i]]%k<<endl; ^ pyk.cpp:63:44: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from pyk.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^
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ă.