#353
Spectacole
La un festival sunt programate n
spectacole. Pentru fiecare se cunoaște momentul de început și momentul de sfârșit, exprimate prin numere naturale. Un spectator dorește să urmărească cât mai multe spectacole în întregime.
Determinați numărul maxim de spectacole care pot fi urmărite, fără ca acestea să se suprapună.
Problema | Spectacole | Operații I/O |
spectacole.in /spectacole.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29886461 | Utilizator | |
Fișier | spectacole.cpp | Dimensiune | 525 B |
Data încărcării | 27 Mai 2021, 23:30 | Scor / rezultat | Eroare de compilare |
spectacole.cpp:13:16: error: 's' does not name a type bool cmp(const s &a, const s &b) ^ spectacole.cpp:13:19: error: ISO C++ forbids declaration of 'a' with no type [-fpermissive] bool cmp(const s &a, const s &b) ^ spectacole.cpp:13:28: error: 's' does not name a type bool cmp(const s &a, const s &b) ^ spectacole.cpp:13:31: error: ISO C++ forbids declaration of 'b' with no type [-fpermissive] bool cmp(const s &a, const s &b) ^ spectacole.cpp: In function 'bool cmp(const int&, const int&)': spectacole.cpp:15:14: error: request for member 'f' in 'a', which is of non-class type 'const int' return a.f <= b.f; ^ spectacole.cpp:15:21: error: request for member 'f' in 'b', which is of non-class type 'const int' return a.f <= b.f; ^ spectacole.cpp: At global scope: spectacole.cpp:22:12: error: expected '}' before ';' token in >> n; ^ spectacole.cpp:22:8: error: invalid user-defined conversion from 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' to 'int' [-fpermissive] in >> n; ^ In file included from /usr/include/c++/4.8/ios:44:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from spectacole.cpp:1: /usr/include/c++/4.8/bits/basic_ios.h:115:7: note: candidate is: std::basic_ios<_CharT, _Traits>::operator void*() const [with _CharT = char; _Traits = std::char_traits<char>] <near match> operator void*() const ^ /usr/include/c++/4.8/bits/basic_ios.h:115:7: note: no known conversion for implicit 'this' parameter from 'void*' to 'int' spectacole.cpp:23:5: error: expected unqualified-id before 'for' for (int i = 0; i < n; i++) ^ spectacole.cpp:23:21: error: 'i' does not name a type for (int i = 0; i < n; i++) ^ spectacole.cpp:23:28: error: 'i' does not name a type for (int i = 0; i < n; i++) ^ spectacole.cpp:25:9: error: expected constructor, destructor, or type conversion before '(' token sort(v, v + n, cmp); ^ spectacole.cpp:26:5: error: expected unqualified-id before 'for' for (int i = 0; i < n; i++) ^ spectacole.cpp:26:21: error: 'i' does not name a type for (int i = 0; i < n; i++) ^ spectacole.cpp:26:28: error: 'i' does not name a type for (int i = 0; i < n; i++) ^ spectacole.cpp:34:5: error: 'out' does not name a type out << c; ^ spectacole.cpp:35:1: error: expected declaration before '}' token } ^ spectacole.cpp: In function 'bool cmp(const int&, const int&)': spectacole.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Spectacole 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ă.