#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 | #12569381 | Utilizator | |
Fișier | spectacole.cpp | Dimensiune | 508 B |
Data încărcării | 05 Decembrie 2018, 11:40 | Scor / rezultat | Eroare de compilare |
spectacole.cpp:11:16: error: 'a' does not name a type int cmp(const a,const b) ^ spectacole.cpp:11:16: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive] spectacole.cpp:11:24: error: 'b' does not name a type int cmp(const a,const b) ^ spectacole.cpp:11:24: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive] spectacole.cpp: In function 'int cmp(int, int)': spectacole.cpp:13:13: error: 'a' was not declared in this scope return a.y < b.y; ^ spectacole.cpp:13:19: error: 'b' was not declared in this scope return a.y < b.y; ^ spectacole.cpp: At global scope: spectacole.cpp:17:9: error: expected '}' before ';' token f>>n; ^ spectacole.cpp:17:6: error: invalid user-defined conversion from 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' to 'int' [-fpermissive] f>>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:18:5: error: expected unqualified-id before 'for' for(i=1; i<= n; i++) ^ spectacole.cpp:18:14: error: 'i' does not name a type for(i=1; i<= n; i++) ^ spectacole.cpp:18:21: error: 'i' does not name a type for(i=1; i<= n; i++) ^ spectacole.cpp:20:10: error: expected constructor, destructor, or type conversion before '(' token sort (v + 1, v + n + 1, cmp) ^ spectacole.cpp:22:5: error: 'ct' does not name a type ct=1; ^ spectacole.cpp:23:5: error: expected unqualified-id before 'for' for(i=2;i<=n;i++) ^ spectacole.cpp:23:13: error: 'i' does not name a type for(i=2;i<=n;i++) ^ spectacole.cpp:23:18: error: 'i' does not name a type for(i=2;i<=n;i++) ^ spectacole.cpp:29:5: error: 'cout' does not name a type cout<<ct; ^ spectacole.cpp:30:5: error: expected unqualified-id before 'return' return 0; ^ spectacole.cpp:31:1: error: expected declaration before '}' token } ^ spectacole.cpp: In function 'int cmp(int, int)': spectacole.cpp:14:2: 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ă.