#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 | #49301985 | Utilizator | |
Fișier | fotbal2.cpp | Dimensiune | 1.92 KB |
Data încărcării | 25 Februarie 2024, 12:05 | Scor / rezultat | Eroare de compilare |
fotbal2.cpp:19:22: error: size of array 'fact' has non-integral type 'double' long long ans, fact[N]; ^ fotbal2.cpp: In function 'long long int binpow(int, int)': fotbal2.cpp:11:14: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' #define mod 1e9 + 9 ^ fotbal2.cpp:35:24: note: in expansion of macro 'mod' return p * p % mod * baza % mod; ^ fotbal2.cpp:11:14: error: invalid operands of types 'int' and 'double' to binary 'operator%' #define mod 1e9 + 9 ^ fotbal2.cpp:35:37: note: in expansion of macro 'mod' return p * p % mod * baza % mod; ^ fotbal2.cpp:11:14: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' #define mod 1e9 + 9 ^ fotbal2.cpp:36:25: note: in expansion of macro 'mod' else return p * p % mod; ^ fotbal2.cpp: In function 'long long int mod_inv(int, int)': fotbal2.cpp:11:14: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' #define mod 1e9 + 9 ^ fotbal2.cpp:40:37: note: in expansion of macro 'mod' return a * binpow(b, mod - 2) % mod; ^ fotbal2.cpp: In function 'long long int comb(int, int)': fotbal2.cpp:11:14: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' #define mod 1e9 + 9 ^ fotbal2.cpp:47:51: note: in expansion of macro 'mod' return mod_inv(fact[n], fact[k] * fact[n-k] % mod); ^ fotbal2.cpp: In function 'int main()': fotbal2.cpp:55:9: error: 'in' was not declared in this scope in >> l >> r >> tip; ^ fotbal2.cpp:11:14: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' #define mod 1e9 + 9 ^ fotbal2.cpp:60:35: note: in expansion of macro 'mod' fact[i] = fact[i-1] * i % mod; ^ fotbal2.cpp:76:25: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' ans %= mod; ^ fotbal2.cpp:76:25: error: in evaluation of 'operator%=(long long int, double)' fotbal2.cpp:83:25: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' ans %= mod; ^ fotbal2.cpp:83:25: error: in evaluation of 'operator%=(long long int, double)' fotbal2.cpp: In function 'long long int binpow(int, int)': fotbal2.cpp:37:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ fotbal2.cpp: In function 'long long int mod_inv(int, int)': fotbal2.cpp:41:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ fotbal2.cpp: In function 'long long int comb(int, int)': fotbal2.cpp:48: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ă.