Submission #929787

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9297872024-02-18 08:03:54PanndaEvent Hopping 2 (JOI21_event2)C++17
0 / 100
149 ms48452 KiB
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 12345;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, k;
cin >> n >> k;
vector<array<int, 2>> a(n);
for (int i = 0; i < n; i++) {
int l, r;
cin >> l >> r;
a[i] = {l, r};
}
auto [next, prev] = [](int n, vector<array<int, 2>> a) {
int log = 32 - __builtin_clz(n);
vector<vector<int>> next(n, vector<int>(log, -1));
vector<vector<int>> prev(n, vector<int>(log, -1));
vector<array<int, 3>> events;
for (int i = 0; i < n; i++) {
events.push_back({ a[i][0], +1, i });
events.push_back({ a[i][1], -1, i });
}
sort(events.begin(), events.end());
priority_queue<array<int, 2>, vector<array<int, 2>>, less<>> mx_pq;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from event2.cpp:1:
event2.cpp: In function 'int main()':
event2.cpp:115:27: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  115 |         assert(key.size() >= k);
      |                ~~~~~~~~~~~^~~~
event2.cpp:103:27: warning: 'cur' may be used uninitialized in this function [-Wmaybe-uninitialized]
  103 |             cur_try = cur - forward_lift(il, r) + forward_lift(i, r) + backward_lift(i, l) + 1;
      |                       ~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...