#1342
NrSubsirCresc
C++
Se consideră un vector cu n
elemente. Să se afle cate subşiruri strict crescătoare se pot forma folosind numerele sale.
Problema | NrSubsirCresc | Operații I/O |
nrsubsircresc.in /nrsubsircresc.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 1 MB
/
Stivă 0.5 MB
|
Id soluție | #54903616 | Utilizator | |
Fișier | nrsubsircresc.cpp | Dimensiune | 812 B |
Data încărcării | 11 Decembrie 2024, 19:19 | Scor / rezultat | Eroare de compilare |
nrsubsircresc.cpp:12:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("nrsubsircresc.in"); ^ nrsubsircresc.cpp:13:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("nrsubsircresc.out"); ^ nrsubsircresc.cpp: In function 'int main()': nrsubsircresc.cpp:18:5: error: reference to 'cin' is ambiguous cin >> n; ^ nrsubsircresc.cpp:12:10: note: candidates are: <typeprefixerror>cin ifstream cin("nrsubsircresc.in"); ^ In file included from nrsubsircresc.cpp:9:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ nrsubsircresc.cpp:20:9: error: reference to 'cin' is ambiguous cin >> a[i]; ^ nrsubsircresc.cpp:12:10: note: candidates are: <typeprefixerror>cin ifstream cin("nrsubsircresc.in"); ^ In file included from nrsubsircresc.cpp:9:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ nrsubsircresc.cpp:21:11: error: 'i' was not declared in this scope s[i] = 1; ^ nrsubsircresc.cpp:26:12: warning: statement has no effect [-Wunused-value] sum+ s[i]; ^ nrsubsircresc.cpp:27:5: error: reference to 'cout' is ambiguous cout<<sum; ^ nrsubsircresc.cpp:13:10: note: candidates are: <typeprefixerror>cout ofstream cout("nrsubsircresc.out"); ^ In file included from nrsubsircresc.cpp:9:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrSubsirCresc 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ă.