#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 | #52007781 | Utilizator | |
Fișier | interclasare.cpp | Dimensiune | 592 B |
Data încărcării | 16 Septembrie 2024, 00:26 | Scor / rezultat | Eroare de compilare |
interclasare.cpp:4:1: error: 'ifstream' does not name a type ifstream fin("interclasare.in"); ^ interclasare.cpp:5:1: error: 'ofstream' does not name a type ofstream fout("interclasare.out") ^ interclasare.cpp:7:20: error: expected unqualified-id before '[' token int a[100001], [100001],c[200001],i=0,j=0,p=0,n,m; ^ interclasare.cpp: In function 'int main()': interclasare.cpp:11:5: error: 'fin' was not declared in this scope fin>>n,m; ^ interclasare.cpp:11:10: error: 'n' was not declared in this scope fin>>n,m; ^ interclasare.cpp:11:12: error: 'm' was not declared in this scope fin>>n,m; ^ interclasare.cpp:12:9: error: 'i' was not declared in this scope for(i=0;i<n;i++) ^ interclasare.cpp:14:9: error: 'j' was not declared in this scope for(j=0;j<m;j++) ^ interclasare.cpp:15:14: error: 'b' was not declared in this scope fin>>b[j]; ^ interclasare.cpp:16:11: error: 'i' was not declared in this scope while(i<n&&j<m) ^ interclasare.cpp:16:16: error: 'j' was not declared in this scope while(i<n&&j<m) ^ interclasare.cpp:18:17: error: 'b' was not declared in this scope if(a[i]<b[j]) ^ interclasare.cpp:19:13: error: 'c' was not declared in this scope c[p++]=a[i++]; ^ interclasare.cpp:19:15: error: 'p' was not declared in this scope c[p++]=a[i++]; ^ interclasare.cpp:21:13: error: 'c' was not declared in this scope c[p++]=[j++]; ^ interclasare.cpp:21:15: error: 'p' was not declared in this scope c[p++]=[j++]; ^ interclasare.cpp:21:22: error: expected ',' before '++' token c[p++]=[j++]; ^ interclasare.cpp:21:22: error: expected identifier before '++' token interclasare.cpp: In lambda function: interclasare.cpp:21:25: error: expected '{' before ';' token c[p++]=[j++]; ^ interclasare.cpp: In function 'int main()': interclasare.cpp:23:11: error: 'i' was not declared in this scope while(i<n) ^ interclasare.cpp:24:9: error: 'c' was not declared in this scope c[p++]=a[i++]; ^ interclasare.cpp:24:11: error: 'p' was not declared in this scope c[p++]=a[i++]; ^ interclasare.cpp:25:11: error: 'j' was not declared in this scope while(j<m) ^ interclasare.cpp:26:9: error: 'c' was not declared in this scope c[p++]=b[j++]; ^ interclasare.cpp:26:11: error: 'p' was not declared in this scope c[p++]=b[j++]; ^ interclasare.cpp:26:16: error: 'b' was not declared in this scope c[p++]=b[j++]; ^ interclasare.cpp:27:9: error: 'p' was not declared in this scope for(p=0;p<n+m;p++) ^ interclasare.cpp:28:9: error: 'fout' was not declared in this scope fout<<c[p]; ^ interclasare.cpp:28:15: error: 'c' was not declared in this scope fout<<c[p]; ^
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ă.