#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 | #64647602 | Utilizator | |
| Fișier | perechi6.cpp | Dimensiune | 487 B |
| Data încărcării | 20 Mai 2026, 12:17 | Scor/rezultat | Eroare de compilare |
perechi6.cpp:6:14: warning: missing terminating " character 6 | ifstream cin("perechi6.in; | ^ perechi6.cpp:6:14: error: missing terminating " character 6 | ifstream cin("perechi6.in; | ^~~~~~~~~~~~~ perechi6.cpp:7:14: error: expected ‘,’ or ‘...’ before ‘(’ token 7 | ofstream cout("perechi6.out"); | ^ perechi6.cpp:7:30: error: expected ‘)’ before ‘;’ token 7 | ofstream cout("perechi6.out"); | ^ | ) perechi6.cpp:6:13: note: to match this ‘(’ 6 | ifstream cin("perechi6.in; | ^ perechi6.cpp: In function ‘int main()’: perechi6.cpp:13:8: error: invalid operands of types ‘std::ifstream(std::ofstream)’ {aka ‘std::basic_ifstream<char>(std::basic_ofstream<char>)’} and ‘int’ to binary ‘operator>>’ 13 | cin>>n; | ~~~^~~ | | | | | int | std::ifstream(std::ofstream) {aka std::basic_ifstream<char>(std::basic_ofstream<char>)} perechi6.cpp:15:12: error: invalid operands of types ‘std::ifstream(std::ofstream)’ {aka ‘std::basic_ifstream<char>(std::basic_ofstream<char>)’} and ‘int’ to binary ‘operator>>’ 15 | cin>>a[i]; | ~~~^~~~~~ | | | | | int | std::ifstream(std::ofstream) {aka std::basic_ifstream<char>(std::basic_ofstream<char>)} perechi6.cpp:16:8: error: invalid operands of types ‘std::ifstream(std::ofstream)’ {aka ‘std::basic_ifstream<char>(std::basic_ofstream<char>)’} and ‘int’ to binary ‘operator>>’ 16 | cin>>m; | ~~~^~~ | | | | | int | std::ifstream(std::ofstream) {aka std::basic_ifstream<char>(std::basic_ofstream<char>)} perechi6.cpp:18:12: error: invalid operands of types ‘std::ifstream(std::ofstream)’ {aka ‘std::basic_ifstream<char>(std::basic_ofstream<char>)’} and ‘int’ to binary ‘operator>>’ 18 | cin>>b[i]; | ~~~^~~~~~ | | | | | int | std::ifstream(std::ofstream) {aka std::basic_ifstream<char>(std::basic_ofstream<char>)} perechi6.cpp:25:5: error: ‘cout’ was not declared in this scope 25 | cout<<cnt; | ^~~~ perechi6.cpp:5:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? 4 | #include <fstream> +++ |+#include <iostream> 5 | using namespace std;
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ă.