#2087
Kminsum
Se consideră un număr natural k
și două tablouri unidimensionale A
și B
, cu n
respectiv m
elemente, numere întregi, sortate crescător. Să se afișeze primele k
perechi de numere de sumă minimă. Fiecare pereche conține un număr din A
, un număr din B
.
Problema | Kminsum | Operații I/O |
kminsum.in /kminsum.out
|
---|---|---|---|
Limita timp | 0.02 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54116438 | Utilizator | |
Fișier | kminsum.cpp | Dimensiune | 762 B |
Data încărcării | 20 Noiembrie 2024, 09:18 | Scor / rezultat | Eroare de compilare |
kminsum.cpp: In function 'int main()': kminsum.cpp:28:2: error: reference to 'cin' is ambiguous cin.tie(nullptr); cout.tie(nullptr); ^ kminsum.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("kminsum.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from kminsum.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ kminsum.cpp:28:20: error: reference to 'cout' is ambiguous cin.tie(nullptr); cout.tie(nullptr); ^ kminsum.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("kminsum.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from kminsum.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ kminsum.cpp:30:2: error: reference to 'cin' is ambiguous cin >> n >> m >> k; ^ kminsum.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("kminsum.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from kminsum.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ kminsum.cpp:32:3: error: reference to 'cin' is ambiguous cin >> a[i]; ^ kminsum.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("kminsum.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from kminsum.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ kminsum.cpp:34:3: error: reference to 'cin' is ambiguous cin >> b[j]; ^ kminsum.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("kminsum.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from kminsum.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ kminsum.cpp:42:3: error: reference to 'cout' is ambiguous cout << p.x << " " << p.y << "\n"; ^ kminsum.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("kminsum.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from kminsum.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Kminsum 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ă.