#4667
Stadionul pe care Taylor Swift concertează în cadrul Turului Eras poate fi reprezentat cu ajutorul unei matrice cu N
linii și M
coloane, numerotate începând de la 1
. În fiecare celulă (i, j)
, de pe linia i
și coloana j
(1 ≤ i ≤ N
și 1 ≤ j ≤ M
), se află câte un scaun pe care pot fi așezate brățări ale prieteniei. Înainte de concert, pe fiecare dintre dintre cele N x M
scaune, nu se află nicio brățară. Pe durata concertului, Steven efectuează, în ordine, U
modificări, care pot fi de două tipuri:
(L, a, v)
cu semnificația că pe fiecare dintre cele M
scaune de pe linia a
sunt așezate câte v
brățări noi (1 ≤ a ≤ N
);(C, a, v)
cu semnificația că pe fiecare dintre cele N
scaune de pe coloana a
sunt așezate câte v
brățări noi (1 ≤ a ≤ M
).După ce toate modificările au fost efectuate, Caroline îi pune lui Steven, în ordine, Q
întrebări. Pentru fiecare întrebare, se consideră un număr natural K
și descrierile a K
submatrice. Steven trebuie să determine câte brățări sunt, în total, pe scaunele ce se află în cel puțin una dintre cele K
submatrice considerate. Ajutați-l pe Steven să răspundă corect la toate cele Q
întrebări puse de Caroline!
ONI 2024, clasa a 9-a
Problema | eras | Operații I/O |
![]() eras.in /eras.out
|
---|---|---|---|
Limita timp | 1.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56791502 | Utilizator | |
Fișier | eras.cpp | Dimensiune | 4.56 KB |
Data încărcării | 05 Martie 2025, 22:23 | Scor / rezultat | Eroare de compilare |
eras.cpp: In lambda function: eras.cpp:42:86: error: parameter declared 'auto' auto lb = lower_bound(rows.begin(), rows.end(), make_pair(L, -1LL), [](auto &p, auto &q){ ^ eras.cpp:42:95: error: parameter declared 'auto' auto lb = lower_bound(rows.begin(), rows.end(), make_pair(L, -1LL), [](auto &p, auto &q){ ^ eras.cpp: In lambda function: eras.cpp:43:20: error: 'p' was not declared in this scope return p.first < q.first; ^ eras.cpp:43:30: error: 'q' was not declared in this scope return p.first < q.first; ^ eras.cpp: In lambda function: eras.cpp:45:89: error: parameter declared 'auto' auto ub = upper_bound(rows.begin(), rows.end(), make_pair(R, 1LL<<60), [](auto &q, auto &p){ ^ eras.cpp:45:98: error: parameter declared 'auto' auto ub = upper_bound(rows.begin(), rows.end(), make_pair(R, 1LL<<60), [](auto &q, auto &p){ ^ eras.cpp: In lambda function: eras.cpp:46:20: error: 'q' was not declared in this scope return q.first < p.first; ^ eras.cpp:46:30: error: 'p' was not declared in this scope return q.first < p.first; ^ eras.cpp: In lambda function: eras.cpp:52:86: error: parameter declared 'auto' auto lb = lower_bound(cols.begin(), cols.end(), make_pair(L, -1LL), [](auto &p, auto &q){ ^ eras.cpp:52:95: error: parameter declared 'auto' auto lb = lower_bound(cols.begin(), cols.end(), make_pair(L, -1LL), [](auto &p, auto &q){ ^ eras.cpp: In lambda function: eras.cpp:53:20: error: 'p' was not declared in this scope return p.first < q.first; ^ eras.cpp:53:30: error: 'q' was not declared in this scope return p.first < q.first; ^ eras.cpp: In lambda function: eras.cpp:55:89: error: parameter declared 'auto' auto ub = upper_bound(cols.begin(), cols.end(), make_pair(R, 1LL<<60), [](auto &q, auto &p){ ^ eras.cpp:55:98: error: parameter declared 'auto' auto ub = upper_bound(cols.begin(), cols.end(), make_pair(R, 1LL<<60), [](auto &q, auto &p){ ^ eras.cpp: In lambda function: eras.cpp:56:20: error: 'q' was not declared in this scope return q.first < p.first; ^ eras.cpp:56:30: error: 'p' was not declared in this scope return q.first < p.first; ^ eras.cpp: In function 'int main()': eras.cpp:71:45: error: converting to 'std::vector<std::tuple<long long int, long long int, long long int, long long int> >::value_type {aka std::tuple<long long int, long long int, long long int, long long int>}' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {long long int&, long long int&, long long int&, long long int&}; <template-parameter-2-2> = void; _Elements = {long long int, long long int, long long int, long long int}]' rects.push_back({x1, y1, x2, y2}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from eras.cpp:4: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<std::pair<long long int, long long int>*, std::vector<std::pair<long long int, long long int> > >; _Tp = std::pair<long long int, long long int>; _Compare = main()::__lambda0::__lambda1]': eras.cpp:44:10: required from here /usr/include/c++/4.8/bits/stl_algo.h:2447:31: error: no match for call to '(main()::__lambda0::__lambda1) (std::pair<long long int, long long int>&, const std::pair<long long int, long long int>&)' if (__comp(*__middle, __val)) ^ eras.cpp:42:78: note: candidates are: auto lb = lower_bound(rows.begin(), rows.end(), make_pair(L, -1LL), [](auto &p, auto &q){ ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from eras.cpp:4: /usr/include/c++/4.8/bits/stl_algo.h:2447:31: note: void (*)() <conversion> if (__comp(*__middle, __val)) ^ /usr/include/c++/4.8/bits/stl_algo.h:2447:31: note: candidate expects 1 argument, 3 provided eras.cpp:42:96: note: main()::__lambda0::__lambda1 auto lb = lower_bound(rows.begin(), rows.end(), make_pair(L, -1LL), [](auto &p, auto &q){ ^ eras.cpp:42:96: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from eras.cpp:4: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_FIter std::upper_bound(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<std::pair<long long int, long long int>*, std::vector<std::pair<long long int, long long int> > >; _Tp = std::pair<long long int, long long int>; _Compare = main()::__lambda0::__lambda2]': eras.cpp:47:10: required from here /usr/include/c++/4.8/bits/stl_algo.h:2543:31: error: no match for call to '(main()::__lambda0::__lambda2) (const std::pair<long long int, long long int>&, std::pair<long long int, long long int>&)' if (__comp(__val, *__middle)) ^ eras.cpp:45:81: note: candidates are: auto ub = upper_bound(rows.begin(), rows.end(), make_pair(R, 1LL<<60), [](auto &q, auto &p){ ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from eras.cpp:4: /usr/include/c++/4.8/bits/stl_algo.h:2543:31: note: void (*)() <conversion> if (__comp(__val, *__middle)) ^ /usr/include/c++/4.8/bits/stl_algo.h:2543:31: note: candidate expects 1 argument, 3 provided eras.cpp:45:99: note: main()::__lambda0::__lambda2 auto ub = upper_bound(rows.begin(), rows.end(), make_pair(R, 1LL<<60), [](auto &q, auto &p){ ^ eras.cpp:45:99: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from eras.cpp:4: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<std::pair<long long int, long long int>*, std::vector<std::pair<long long int, long long int> > >; _Tp = std::pair<long long int, long long int>; _Compare = main()::__lambda3::__lambda4]': eras.cpp:54:10: required from here /usr/include/c++/4.8/bits/stl_algo.h:2447:31: error: no match for call to '(main()::__lambda3::__lambda4) (std::pair<long long int, long long int>&, const std::pair<long long int, long long int>&)' if (__comp(*__middle, __val)) ^ eras.cpp:52:78: note: candidates are: auto lb = lower_bound(cols.begin(), cols.end(), make_pair(L, -1LL), [](auto &p, auto &q){ ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from eras.cpp:4: /usr/include/c++/4.8/bits/stl_algo.h:2447:31: note: void (*)() <conversion> if (__comp(*__middle, __val)) ^ /usr/include/c++/4.8/bits/stl_algo.h:2447:31: note: candidate expects 1 argument, 3 provided eras.cpp:52:96: note: main()::__lambda3::__lambda4 auto lb = lower_bound(cols.begin(), cols.end(), make_pair(L, -1LL), [](auto &p, auto &q){ ^ eras.cpp:52:96: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from eras.cpp:4: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_FIter std::upper_bound(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<std::pair<long long int, long long int>*, std::vector<std::pair<long long int, long long int> > >; _Tp = std::pair<long long int, long long int>; _Compare = main()::__lambda3::__lambda5]': eras.cpp:57:10: required from here /usr/include/c++/4.8/bits/stl_algo.h:2543:31: error: no match for call to '(main()::__lambda3::__lambda5) (const std::pair<long long int, long long int>&, std::pair<long long int, long long int>&)' if (__comp(__val, *__middle)) ^ eras.cpp:55:81: note: candidates are: auto ub = upper_bound(cols.begin(), cols.end(), make_pair(R, 1LL<<60), [](auto &q, auto &p){ ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from eras.cpp:4: /usr/include/c++/4.8/bits/stl_algo.h:2543:31: note: void (*)() <conversion> if (__comp(__val, *__middle)) ^ /usr/include/c++/4.8/bits/stl_algo.h:2543:31: note: candidate expects 1 argument, 3 provided eras.cpp:55:99: note: main()::__lambda3::__lambda5 auto ub = upper_bound(cols.begin(), cols.end(), make_pair(R, 1LL<<60), [](auto &q, auto &p){ ^ eras.cpp:55:99: note: candidate expects 0 arguments, 2 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema eras 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ă.