#3824
Se dau două șiruri de numere întregi, ordonate crescător. Șirul x[] contine n numere întregi ordonate crescător, șirul y[] conține m numere întregi ordonate crescător. Să se calculeze numărul de perechi de forma (x[i], y[j]) unde x[i] = y[j] și x[i] ∊ X, respectiv y[j] ∊ Y.
| Problema | Perechi6 | Operații I/O |
perechi6.in/perechi6.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63975656 | Utilizator | |
| Fișier | perechi6.cpp | Dimensiune | 1021 B |
| Data încărcării | 31 Martie 2026, 23:35 | Scor/rezultat | Eroare de compilare |
perechi6.cpp: In function 'int main()': perechi6.cpp:7:5: error: expected ',' or ';' before 'ofstream' ofstream fout("perechi6.out") ^ perechi6.cpp:9:10: error: 'n' was not declared in this scope fin>>n; ^ perechi6.cpp:11:14: error: 'x' was not declared in this scope fin>>x[i]; ^ perechi6.cpp:12:10: error: 'm' was not declared in this scope fin>>m; ^ perechi6.cpp:14:14: error: 'y' was not declared in this scope fin>>y[i]; ^ perechi6.cpp:17:9: error: 'st' was not declared in this scope st=1; ^ perechi6.cpp:18:9: error: 'dr' was not declared in this scope dr=m; ^ perechi6.cpp:19:9: error: 'poz' was not declared in this scope poz=0; ^ perechi6.cpp:22:13: error: 'mi' was not declared in this scope mi=(st+dr)/2; ^ perechi6.cpp:23:16: error: 'x' was not declared in this scope if(x[i]==y[mi]) ^ perechi6.cpp:23:22: error: 'y' was not declared in this scope if(x[i]==y[mi]) ^ perechi6.cpp:33:13: error: 'p' was not declared in this scope p++; ^ perechi6.cpp:34:21: error: 'z' was not declared in this scope z=1; ^ perechi6.cpp:35:27: error: 'y' was not declared in this scope while(poz-z>=1 && y[poz]==y[poz-z]) ^ perechi6.cpp:41:27: error: 'y' was not declared in this scope while(poz+z<=m && y[poz]==y[poz+z]) ^ perechi6.cpp:48:5: error: 'fout' was not declared in this scope fout<<p; ^ perechi6.cpp:48:11: error: 'p' was not declared in this scope fout<<p; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Perechi6 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ă.