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