#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 | #53518854 | Utilizator | |
Fișier | spectacole.cpp | Dimensiune | 865 B |
Data încărcării | 04 Noiembrie 2024, 09:05 | Scor / rezultat | Eroare de compilare |
spectacole.cpp:3:18: error: expected unqualified-id before ')' token struct spectacol() ^ spectacole.cpp:6:3: error: 'v' does not name a type } v[1001], aux; ^ spectacole.cpp: In function 'void sort()': spectacole.cpp:15:10: error: 'v' was not declared in this scope if(v[j].b > v[j+1].b) ^ spectacole.cpp:17:11: error: 'aux' was not declared in this scope aux = v[j]; ^ spectacole.cpp:23:5: error: expected primary-expression before '}' token } ^ spectacole.cpp:23:5: error: expected ';' before '}' token spectacole.cpp:24:9: error: expected 'while' before 'main' int main() ^ spectacole.cpp:24:9: error: expected '(' before 'main' spectacole.cpp:24:14: error: 'main' was not declared in this scope int main() ^ spectacole.cpp:25:5: error: expected ')' before '{' token { ^ spectacole.cpp:25:5: error: expected ';' before '{' token spectacole.cpp:30:15: error: 'v' was not declared in this scope f >> v[i].a >> v[i].b; ^ spectacole.cpp:33:10: error: reference to 'ref' is ambiguous ref = v[1].b; ^ spectacole.cpp:7:9: note: candidates are: int ref int n, ref, i, ct; ^ In file included from /usr/include/c++/4.8/bits/stl_algo.h:66:0, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from spectacole.cpp:1: /usr/include/c++/4.8/functional:493:5: note: template<class _Tp> std::reference_wrapper<_Tp> std::ref(std::reference_wrapper<_Tp>) ref(reference_wrapper<_Tp> __t) noexcept ^ /usr/include/c++/4.8/functional:485:10: note: template<class _Tp> void std::ref(const _Tp&&) void ref(const _Tp&&) = delete; ^ /usr/include/c++/4.8/functional:475:5: note: template<class _Tp> std::reference_wrapper<_Tp> std::ref(_Tp&) ref(_Tp& __t) noexcept ^ spectacole.cpp:33:16: error: 'v' was not declared in this scope ref = v[1].b; ^ spectacole.cpp:36:25: error: reference to 'ref' is ambiguous if(v[i] >= ref) ^ spectacole.cpp:7:9: note: candidates are: int ref int n, ref, i, ct; ^ In file included from /usr/include/c++/4.8/bits/stl_algo.h:66:0, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from spectacole.cpp:1: /usr/include/c++/4.8/functional:493:5: note: template<class _Tp> std::reference_wrapper<_Tp> std::ref(std::reference_wrapper<_Tp>) ref(reference_wrapper<_Tp> __t) noexcept ^ /usr/include/c++/4.8/functional:485:10: note: template<class _Tp> void std::ref(const _Tp&&) void ref(const _Tp&&) = delete; ^ /usr/include/c++/4.8/functional:475:5: note: template<class _Tp> std::reference_wrapper<_Tp> std::ref(_Tp&) ref(_Tp& __t) noexcept ^ spectacole.cpp:39:18: error: reference to 'ref' is ambiguous ref = v[i].b; ^ spectacole.cpp:7:9: note: candidates are: int ref int n, ref, i, ct; ^ In file included from /usr/include/c++/4.8/bits/stl_algo.h:66:0, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from spectacole.cpp:1: /usr/include/c++/4.8/functional:493:5: note: template<class _Tp> std::reference_wrapper<_Tp> std::ref(std::reference_wrapper<_Tp>) ref(reference_wrapper<_Tp> __t) noexcept ^ /usr/include/c++/4.8/functional:485:10: note: template<class _Tp> void std::ref(const _Tp&&) void ref(const _Tp&&) = delete; ^ /usr/include/c++/4.8/functional:475:5: note: template<class _Tp> std::reference_wrapper<_Tp> std::ref(_Tp&) ref(_Tp& __t) noexcept ^ spectacole.cpp:43:17: error: return-statement with a value, in function returning 'void' [-fpermissive] return 0; ^
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ă.