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