#4394
fotbal2
Cei N
copii de la școala generală vor să formeze o echipă de fotbal compusă din K
elevi, dintre care cel puțin unul stângaci și cel puțin unul dreptaci. Pentru fiecare copil i
(de la 0
la N-1
) se cunoaște intervalul de timp în care acesta este disponibil pentru a face parte din echipă, sub forma unei perechi, [start
i
, end
i
]
, cât și dacă este stângaci sau dreptaci. K
copii pot juca în aceeași echipa dacă intervalele de timp în care aceștia sunt disponibili se suprapun în cel puțin un punct (moment de timp). Se cere numărul de moduri în care se poate alcătui o echipă cu K
dintre cei N
elevi; deoarece acest număr poate să fie foarte mare, el se va afișa modulo 1.000.000.009
.
Problema | fotbal2 | Operații I/O |
![]() fotbal.in /fotbal.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49336625 | Utilizator | |
Fișier | fotbal2.cpp | Dimensiune | 2.09 KB |
Data încărcării | 26 Februarie 2024, 19:23 | Scor / rezultat | Eroare de compilare |
fotbal2.cpp:18:1: error: 'ev' does not name a type ev events[2 * nmax + 3]; ^ fotbal2.cpp:20:16: error: 'ev' does not name a type bool cmp(const ev & s1, const ev & s2){ ^ fotbal2.cpp:20:21: error: ISO C++ forbids declaration of 's1' with no type [-fpermissive] bool cmp(const ev & s1, const ev & s2){ ^ fotbal2.cpp:20:31: error: 'ev' does not name a type bool cmp(const ev & s1, const ev & s2){ ^ fotbal2.cpp:20:36: error: ISO C++ forbids declaration of 's2' with no type [-fpermissive] bool cmp(const ev & s1, const ev & s2){ ^ fotbal2.cpp: In function 'bool cmp(const int&, const int&)': fotbal2.cpp:21:11: error: request for member 'moment' in 's1', which is of non-class type 'const int' if(s1.moment == s2.moment) /// daca lucram cu acelasi moment de timp ^ fotbal2.cpp:21:24: error: request for member 'moment' in 's2', which is of non-class type 'const int' if(s1.moment == s2.moment) /// daca lucram cu acelasi moment de timp ^ fotbal2.cpp:22:19: error: request for member 'tip_op' in 's1', which is of non-class type 'const int' return s1.tip_op < s2.tip_op; /// vrem ca evenimentele de iesire sa fie ultimele ^ fotbal2.cpp:22:31: error: request for member 'tip_op' in 's2', which is of non-class type 'const int' return s1.tip_op < s2.tip_op; /// vrem ca evenimentele de iesire sa fie ultimele ^ fotbal2.cpp:23:15: error: request for member 'moment' in 's1', which is of non-class type 'const int' return s1.moment < s2.moment; /// daca avem pozitii diferite, vrem sa procesam mai intai evenimentele apropiate ^ fotbal2.cpp:23:27: error: request for member 'moment' in 's2', which is of non-class type 'const int' return s1.moment < s2.moment; /// daca avem pozitii diferite, vrem sa procesam mai intai evenimentele apropiate ^ fotbal2.cpp: In function 'int main()': fotbal2.cpp:68:9: error: 'events' was not declared in this scope events[2 * i +1] = {x, 0, (bool)z};///intrare ^ fotbal2.cpp:72:10: error: 'events' was not declared in this scope sort(events+1, events + 2 * n+1, cmp); ^ fotbal2.cpp: In function 'bool cmp(const int&, const int&)': fotbal2.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema fotbal2 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ă.