#1865
Summit
Se dă un şir x
format din n
numere naturale nenule. Pentru fiecare element x
i
din şir să se verifice dacă există un număr k
astfel încât elementul x
i
să fie egal cu suma primelor k
elemente din şir.
Problema | Summit | Operații I/O |
summit.in /summit.out
|
---|---|---|---|
Limita timp | 0.7 secunde | Limita memorie |
Total: 10 MB
/
Stivă 2 MB
|
Id soluție | #21748466 | Utilizator | |
Fișier | summit.cpp | Dimensiune | 906 B |
Data încărcării | 12 Martie 2020, 11:31 | Scor / rezultat | Eroare de compilare |
summit.cpp: In function 'void cit(int, int)': summit.cpp:6:2: error: 'ifstream' was not declared in this scope {ifstream f("summit.in"); ^ summit.cpp:6:2: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from summit.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ summit.cpp:6:11: error: expected ';' before 'f' {ifstream f("summit.in"); ^ summit.cpp:8:9: error: 'f' was not declared in this scope f>> x[li]; ^ summit.cpp: In function 'void afis(int, int)': summit.cpp:31:2: error: 'ofstream' was not declared in this scope {ofstream g("summit.out"); ^ summit.cpp:31:2: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from summit.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ summit.cpp:31:11: error: expected ';' before 'g' {ofstream g("summit.out"); ^ summit.cpp:34:8: error: 'g' was not declared in this scope g <<'1'<< endl; ^ summit.cpp:34:18: error: 'endl' was not declared in this scope g <<'1'<< endl; ^ summit.cpp:34:18: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from summit.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ summit.cpp:37:13: error: 'g' was not declared in this scope g << li-1<< endl; ^ summit.cpp:37:25: error: 'endl' was not declared in this scope g << li-1<< endl; ^ summit.cpp:37:25: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from summit.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ summit.cpp:39:11: error: 'g' was not declared in this scope g<< '0' << endl; ^ summit.cpp:39:22: error: 'endl' was not declared in this scope g<< '0' << endl; ^ summit.cpp:39: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 summit.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ summit.cpp: In function 'int main()': summit.cpp:50:2: error: 'ifstream' was not declared in this scope {ifstream f("summit.in"); ^ summit.cpp:50:2: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from summit.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ summit.cpp:50:11: error: expected ';' before 'f' {ifstream f("summit.in"); ^ summit.cpp:51:5: error: 'f' was not declared in this scope f>>n; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Summit 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ă.