#241
Interclasare
Se dau două şiruri a
şi b
, cu n
, respectiv m
elemente, numere naturale, ordonate crescător. Să se construiască un al treilea şir, c
, care să conţină, în ordine crescătoare, elementele din şirurile a
şi b
.
Problema | Interclasare | Operații I/O |
interclasare.in /interclasare.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 32 MB
|
Id soluție | #50134547 | Utilizator | |
Fișier | interclasare.cpp | Dimensiune | 753 B |
Data încărcării | 28 Martie 2024, 10:20 | Scor / rezultat | Eroare de compilare |
interclasare.cpp: In function 'int main()': interclasare.cpp:10:5: error: reference to 'cin' is ambiguous cin>>n; ^ interclasare.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("interclasare.in"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ interclasare.cpp:12:9: error: reference to 'cin' is ambiguous cin>>v[i]; ^ interclasare.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("interclasare.in"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ interclasare.cpp:13:5: error: reference to 'cin' is ambiguous cin>>m; ^ interclasare.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("interclasare.in"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ interclasare.cpp:15:9: error: reference to 'cin' is ambiguous cin>>a[j]; ^ interclasare.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("interclasare.in"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ interclasare.cpp:19:24: error: reference to 'cout' is ambiguous if(v[x]>a[y]) {cout<<a[y]<<" "; y++;} ^ interclasare.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("interclasare.out"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ interclasare.cpp:20:15: error: reference to 'cout' is ambiguous else {cout<<v[x]<<" "; x++;} ^ interclasare.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("interclasare.out"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ interclasare.cpp:21:21: error: reference to 'cout' is ambiguous if(k%10==0) cout<<endl; ^ interclasare.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("interclasare.out"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ interclasare.cpp:25:14: error: reference to 'cout' is ambiguous {cout<<v[i]<<" "; ^ interclasare.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("interclasare.out"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ interclasare.cpp:26:31: error: reference to 'cout' is ambiguous k++; if(k%10==0) cout<<endl;} ^ interclasare.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("interclasare.out"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ interclasare.cpp:30:14: error: reference to 'cout' is ambiguous {cout<<a[i]<<" "; ^ interclasare.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("interclasare.out"); ^ In file included from interclasare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ interclasare.cpp:31:31: error: reference to 'cout' is ambiguous k++; if(k%10==0) cout<<endl;} ^ interclasare.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("interclasare.out"); ^ In file included from interclasare.cpp:1: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 Interclasare 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ă.