Submission #1038144

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10381442024-07-29 13:28:57juicyRailway Trip 2 (JOI22_ho_t4)C++17
100 / 100
277 ms233556 KiB
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
const int N = 1e5 + 5, LG = 17;
int n, k, m, q;
int lg[N], a[2 * N], b[2 * N];
array<int, 2> spt[LG][LG][N], A[N];
vector<int> add[N], del[N];
array<int, 2> operator + (const array<int, 2> &a, const array<int, 2> &b) {
return {min(a[0], b[0]), max(a[1], b[1])};
}
array<int, 2> qry(int k, int l, int r) {
int f = lg[r - l + 1];
return spt[k][f][l] + spt[k][f][r - (1 << f) + 1];
}
void init(array<int, 2> spt[LG][N]) {
for (int i = 1; i <= n; ++i) {
spt[0][i] = A[i];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'void init(std::array<int, 2> (*)[100005])':
Main.cpp:33:58: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   33 |       spt[j][i] = spt[j - 1][i] + spt[j - 1][i + (1 << j - 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...