#2217
Domnul Map vă pune la dispoziție un șir a[1]
, a[2]
, …, a[n]
de numere naturale. Pentru fiecare a[i]
(i=1..n
) trebuie să spuneți de câte ori apare acest element în secvența a[1]
, a[2]
, …, a[i]
.
Problema | Map | Operații I/O |
![]() map.in /map.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56983461 | Utilizator | |
Fișier | map.cpp | Dimensiune | 340 B |
Data încărcării | 12 Martie 2025, 12:09 | Scor / rezultat | Eroare de compilare |
map.cpp: In function 'int main()': map.cpp:7:17: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("map.in"); ^ map.cpp:8:27: error: no matching function for call to 'std::basic_ostream<char>::basic_ostream(const char [8])' ostream cout("map.out"); ^ map.cpp:8:27: note: candidates are: In file included from /usr/include/c++/4.8/iostream:39:0, from map.cpp:1: /usr/include/c++/4.8/ostream:384:7: note: std::basic_ostream<_CharT, _Traits>::basic_ostream() [with _CharT = char; _Traits = std::char_traits<char>] basic_ostream() ^ /usr/include/c++/4.8/ostream:384:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/4.8/ostream:84:7: note: std::basic_ostream<_CharT, _Traits>::basic_ostream(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>] basic_ostream(__streambuf_type* __sb) ^ /usr/include/c++/4.8/ostream:84:7: note: no known conversion for argument 1 from 'const char [8]' to 'std::basic_ostream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}' map.cpp:9:9: warning: unused variable 'l' [-Wunused-variable] int n, l=1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Map 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ă.