#1354
varf
Se consideră un şir a
cu n
numere naturale distincte: a
1
, a
2
,..., a
n
.
Să se genereze în ordine lexicografică toate subşirurile vârf
ale şirului a
, de lungime k≥3
.
Problema | varf | Operații I/O |
varf.in /varf.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 2 MB
|
Id soluție | #29057367 | Utilizator | |
Fișier | varf.cpp | Dimensiune | 1.61 KB |
Data încărcării | 29 Martie 2021, 18:04 | Scor / rezultat | Eroare de compilare |
varf.cpp: In function 'void afis(int)': varf.cpp:11:9: error: reference to 'cout' is ambiguous cout << rez[i] << ' '; ^ varf.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout ("varf.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from varf.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ varf.cpp:12:5: error: reference to 'cout' is ambiguous cout << '\n'; ^ varf.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout ("varf.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from varf.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ varf.cpp: In function 'void backt(int, int, int)': varf.cpp:37:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int j = 0; j < nextmax[i].size(); j ++) ^ varf.cpp:47:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int j = 0; j < nextmin[i].size(); j ++) ^ varf.cpp: In function 'int main()': varf.cpp:56:5: error: reference to 'cin' is ambiguous cin >> n; ^ varf.cpp:3:10: note: candidates are: std::ifstream cin ifstream cin ("varf.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from varf.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ varf.cpp:58:9: error: reference to 'cin' is ambiguous cin >> a[i]; ^ varf.cpp:3:10: note: candidates are: std::ifstream cin ifstream cin ("varf.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from varf.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ varf.cpp:65:18: error: reference to 'cout' is ambiguous if (cnt == 0)cout << '0'; ^ varf.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout ("varf.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from varf.cpp:1: /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 varf 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ă.