Submission #929858

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9298582024-02-18 08:23:00PanndaEvent Hopping 2 (JOI21_event2)C++17
0 / 100
187 ms51276 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);
set<array<int, 2>> existed;
for (int i = 0; i < n; i++) {
int l, r;
cin >> l >> r;
a[i] = {l, r};
if (existed.count(a[i])) {
a[i] = {-INF + 1, INF - 1};
} else {
existed.insert(a[i]);
}
}
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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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:121:27: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  121 |         assert(key.size() >= k);
      |                ~~~~~~~~~~~^~~~
event2.cpp:109:27: warning: 'cur' may be used uninitialized in this function [-Wmaybe-uninitialized]
  109 |             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...