#284
Se dau două şiruri, cu n, respectiv m, elemente, numere naturale. Primul şir este ordonat crescător, iar al doilea element este ordonat descrescător. Să se afişeze, în ordine crescătoare, valorile pare din cele două şiruri.
| Problema | Interclasare3 | Operații I/O |
interclasare3.in/interclasare3.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64598470 | Utilizator | |
| Fișier | interclasare3.cpp | Dimensiune | 797 B |
| Data încărcării | 17 Mai 2026, 22:48 | Scor/rezultat | Eroare de compilare |
interclasare3.cpp:3:12: warning: missing terminating " character 3 | ifstream f("interclasare3.in”); | ^ interclasare3.cpp:3:12: error: missing terminating " character 3 | ifstream f("interclasare3.in”); | ^~~~~~~~~~~~~~~~~~~~ interclasare3.cpp:4:12: warning: missing terminating " character 4 | ofstream g("interclasare3.out”); | ^ interclasare3.cpp:4:12: error: missing terminating " character 4 | ofstream g("interclasare3.out”); | ^~~~~~~~~~~~~~~~~~~~~ interclasare3.cpp:24:22: warning: missing terminating " character 24 | g << c[i] << " “; | ^ interclasare3.cpp:24:22: error: missing terminating " character 24 | g << c[i] << " “; | ^~~~ interclasare3.cpp:5:16: error: ‘b’ has not been declared 5 | int a[100001], b[100001], c[200001], n, m, k = 0; | ^ interclasare3.cpp:5:27: error: ‘c’ has not been declared 5 | int a[100001], b[100001], c[200001], n, m, k = 0; | ^ interclasare3.cpp:5:38: error: ‘n’ has not been declared 5 | int a[100001], b[100001], c[200001], n, m, k = 0; | ^ interclasare3.cpp:5:41: error: ‘m’ has not been declared 5 | int a[100001], b[100001], c[200001], n, m, k = 0; | ^ interclasare3.cpp:5:44: error: ‘k’ has not been declared 5 | int a[100001], b[100001], c[200001], n, m, k = 0; | ^ interclasare3.cpp:5:46: error: default arguments are only permitted for function parameters [-fpermissive] 5 | int a[100001], b[100001], c[200001], n, m, k = 0; | ^ interclasare3.cpp:5:49: error: expected ‘)’ before ‘;’ token 5 | int a[100001], b[100001], c[200001], n, m, k = 0; | ^ | ) interclasare3.cpp:4:11: note: to match this ‘(’ 4 | ofstream g("interclasare3.out”); | ^ interclasare3.cpp:5:49: error: expected ‘)’ before ‘;’ token 5 | int a[100001], b[100001], c[200001], n, m, k = 0; | ^ | ) interclasare3.cpp:3:11: note: to match this ‘(’ 3 | ifstream f("interclasare3.in”); | ^ interclasare3.cpp: In function ‘int main()’: interclasare3.cpp:8:10: error: ‘n’ was not declared in this scope; did you mean ‘yn’? 8 | f >> n >> m; | ^ | yn interclasare3.cpp:8:15: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 8 | f >> n >> m; | ^ | tm interclasare3.cpp:9:39: error: ‘a’ was not declared in this scope 9 | for (int i = 1; i <= n; ++i) f >> a[i]; | ^ interclasare3.cpp:10:39: error: ‘b’ was not declared in this scope 10 | for (int j = 1; j <= m; ++j) f >> b[j]; | ^ interclasare3.cpp:13:13: error: ‘a’ was not declared in this scope 13 | if (a[i] < b[j] && a[i] % 2 == 0) c[++k] = a[i++]; | ^ interclasare3.cpp:13:20: error: ‘b’ was not declared in this scope 13 | if (a[i] < b[j] && a[i] % 2 == 0) c[++k] = a[i++]; | ^ interclasare3.cpp:13:43: error: ‘c’ was not declared in this scope 13 | if (a[i] < b[j] && a[i] % 2 == 0) c[++k] = a[i++]; | ^ interclasare3.cpp:13:47: error: ‘k’ was not declared in this scope 13 | if (a[i] < b[j] && a[i] % 2 == 0) c[++k] = a[i++]; | ^ interclasare3.cpp:15:32: error: ‘c’ was not declared in this scope 15 | else if(b[j] % 2 == 0) c[++k] = b[j--]; | ^ interclasare3.cpp:15:36: error: ‘k’ was not declared in this scope 15 | else if(b[j] % 2 == 0) c[++k] = b[j--]; | ^ interclasare3.cpp:18:13: error: ‘a’ was not declared in this scope 18 | if (a[i] % 2 == 0) c[++k] = a[i]; | ^ interclasare3.cpp:18:28: error: ‘c’ was not declared in this scope 18 | if (a[i] % 2 == 0) c[++k] = a[i]; | ^ interclasare3.cpp:18:32: error: ‘k’ was not declared in this scope 18 | if (a[i] % 2 == 0) c[++k] = a[i]; | ^ interclasare3.cpp:21:13: error: ‘b’ was not declared in this scope 21 | if (b[j] % 2 == 0) c[++k] = b[j]; | ^ interclasare3.cpp:21:28: error: ‘c’ was not declared in this scope 21 | if (b[j] % 2 == 0) c[++k] = b[j]; | ^ interclasare3.cpp:21:32: error: ‘k’ was not declared in this scope 21 | if (b[j] % 2 == 0) c[++k] = b[j]; | ^ interclasare3.cpp:23:28: error: ‘k’ was not declared in this scope 23 | } for (int i = 1; i <= k; ++i) { | ^ interclasare3.cpp:24:9: error: ‘g’ was not declared in this scope 24 | g << c[i] << " “; | ^ interclasare3.cpp:24:14: error: ‘c’ was not declared in this scope 24 | g << c[i] << " “; | ^ interclasare3.cpp:25:9: error: expected primary-expression before ‘if’ 25 | if (i % 20 == 0) g << endl; | ^~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Interclasare3 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ă.