#241
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 | #63678237 | Utilizator | |
| Fișier | interclasare.cpp | Dimensiune | 619 B |
| Data încărcării | 14 Martie 2026, 09:34 | Scor/rezultat | Eroare de compilare |
interclasare.cpp:4:14: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin ("interclasare.in"); ^ interclasare.cpp:5:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("interclasare.out"); ^ interclasare.cpp: In function 'int main()': interclasare.cpp:8:10: error: 'n' was not declared in this scope fin>>n; ^ interclasare.cpp:9:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ interclasare.cpp:11:14: error: 'a' was not declared in this scope fin>>a[i]; ^ interclasare.cpp:13:10: error: 'm' was not declared in this scope fin>>m; ^ interclasare.cpp:14:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ interclasare.cpp:16:14: error: 'b' was not declared in this scope fin>>b[i]; ^ interclasare.cpp:19:5: error: 'p' was not declared in this scope p = 0; ^ interclasare.cpp:21:12: error: 'a' was not declared in this scope if(a[i] < b[j]) ^ interclasare.cpp:21:19: error: 'b' was not declared in this scope if(a[i] < b[j]) ^ interclasare.cpp:22:13: error: 'c' was not declared in this scope c[p ++] = a[i ++]; ^ interclasare.cpp:24:13: error: 'c' was not declared in this scope c[p ++] = b[j ++]; ^ interclasare.cpp:26:9: error: 'c' was not declared in this scope c[p ++] = a[i ++]; ^ interclasare.cpp:26:19: error: 'a' was not declared in this scope c[p ++] = a[i ++]; ^ interclasare.cpp:28:9: error: 'c' was not declared in this scope c[p ++] = b[j ++]; ^ interclasare.cpp:28:19: error: 'b' was not declared in this scope c[p ++] = b[j ++]; ^ interclasare.cpp:32:11: error: 'c' was not declared in this scope fout<<c[i]; ^
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ă.