#4370
kda
Dându-se o listă conținând KDA-urilor celor N
prieteni ai lui Gigel și mărimea unei echipe k
, Gigel dorește să afle care este qE
-ul celei mai neechilibrate echipe. Astfel el calculează qE
-ul tuturor echipelor posibile (\(\frac{N!}{k!(N-k)!}\) la număr) și apoi alege qE
-ul maxim posibil.
Info-Oltenia 2023, individual 10
Problema | kda | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 128 MB
/
Stivă 64 MB
|
Id soluție | #42580186 | Utilizator | |
Fișier | kda.cpp | Dimensiune | 1.15 KB |
Data încărcării | 10 Martie 2023, 21:59 | Scor / rezultat | Eroare de compilare |
In file included from /usr/include/c++/4.8/algorithm:62:0, from kda.cpp:3: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Tp = int; _Compare = main()::__lambda0]': /usr/include/c++/4.8/bits/stl_algo.h:2296:78: required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = main()::__lambda0]' /usr/include/c++/4.8/bits/stl_algo.h:2337:62: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Size = int; _Compare = main()::__lambda0]' /usr/include/c++/4.8/bits/stl_algo.h:5499:44: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = main()::__lambda0]' kda.cpp:53:75: required from here /usr/include/c++/4.8/bits/stl_algo.h:2263:35: error: no match for call to '(main()::__lambda0) (int&, const int&)' while (__comp(*__first, __pivot)) ^ kda.cpp:53:32: note: candidates are: sort(a.begin(), a.end(), [&] (int& x, int& y) -> int { return x > y; }); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from kda.cpp:3: /usr/include/c++/4.8/bits/stl_algo.h:2263:35: note: int (*)(int&, int&) <conversion> while (__comp(*__first, __pivot)) ^ /usr/include/c++/4.8/bits/stl_algo.h:2263:35: note: candidate expects 3 arguments, 3 provided kda.cpp:53:54: note: main()::__lambda0 sort(a.begin(), a.end(), [&] (int& x, int& y) -> int { return x > y; }); ^ kda.cpp:53:54: note: no known conversion for argument 2 from 'const int' to 'int&' In file included from /usr/include/c++/4.8/algorithm:62:0, from kda.cpp:3: /usr/include/c++/4.8/bits/stl_algo.h:2266:34: error: no match for call to '(main()::__lambda0) (const int&, int&)' while (__comp(__pivot, *__last)) ^ kda.cpp:53:32: note: candidates are: sort(a.begin(), a.end(), [&] (int& x, int& y) -> int { return x > y; }); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from kda.cpp:3: /usr/include/c++/4.8/bits/stl_algo.h:2266:34: note: int (*)(int&, int&) <conversion> while (__comp(__pivot, *__last)) ^ /usr/include/c++/4.8/bits/stl_algo.h:2266:34: note: candidate expects 3 arguments, 3 provided kda.cpp:53:54: note: main()::__lambda0 sort(a.begin(), a.end(), [&] (int& x, int& y) -> int { return x > y; }); ^ kda.cpp:53:54: note: no known conversion for argument 1 from 'const int' to 'int&'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema kda 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ă.