#3824
Perechi6
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 | #58033386 | Utilizator | |
Fișier | perechi6.cpp | Dimensiune | 985 B |
Data încărcării | 09 Mai 2025, 16:31 | Scor / rezultat | Eroare de compilare |
perechi6.cpp:6:11: error: variable 'std::ifstream f' has initializer but incomplete type ifstream f("perechi6.in"); ^ perechi6.cpp:7:11: error: variable 'std::ofstream g' has initializer but incomplete type ofstream g("perechi6.out"); ^ perechi6.cpp: In function 'int main()': perechi6.cpp:14:12: error: 'a' was not declared in this scope f>>a[i]; ^ perechi6.cpp:17:12: error: 'b' was not declared in this scope f>>b[i]; ^ perechi6.cpp:21:12: error: 'a' was not declared in this scope if(a[i-1]==a[i])nr++; ^ perechi6.cpp:24:13: error: 'aa' was not declared in this scope aa[j]=nr; ^ perechi6.cpp:28:5: error: 'aa' was not declared in this scope aa[j]=nr; ^ perechi6.cpp:33:12: error: 'b' was not declared in this scope if(b[i-1]==b[i])nr++; ^ perechi6.cpp:36:13: error: 'bb' was not declared in this scope bb[j]=nr; ^ perechi6.cpp:40:5: error: 'bb' was not declared in this scope bb[j]=nr; ^ perechi6.cpp:46:12: error: 'a' was not declared in this scope if(a[i]==b[j]) ^ perechi6.cpp:46:18: error: 'b' was not declared in this scope if(a[i]==b[j]) ^ perechi6.cpp:10:14: warning: unused variable 'v' [-Wunused-variable] int n,m, v[100001], w[100001],i,j,nr=0,x,k1,k2; ^ perechi6.cpp:10:25: warning: unused variable 'w' [-Wunused-variable] int n,m, v[100001], w[100001],i,j,nr=0,x,k1,k2; ^ perechi6.cpp:10:44: warning: unused variable 'x' [-Wunused-variable] int n,m, v[100001], w[100001],i,j,nr=0,x,k1,k2; ^ perechi6.cpp:10:46: warning: unused variable 'k1' [-Wunused-variable] int n,m, v[100001], w[100001],i,j,nr=0,x,k1,k2; ^ perechi6.cpp:10:49: warning: unused variable 'k2' [-Wunused-variable] int n,m, v[100001], w[100001],i,j,nr=0,x,k1,k2; ^
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ă.