Submission #878382

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8783822023-11-24 09:26:46TAhmed33Tourism (JOI23_tourism)C++98
28 / 100
5052 ms105300 KiB
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("Ofast")
const int MAXN = 4e5 + 25;
#define mid ((l + r) >> 1)
#define tl (node + 1)
#define tr (node + 2 * (mid - l + 1))
struct SegmentTree {
int tree[2 * MAXN];
void insert (int x) {
tree[x]++;
}
void erase (int x) {
tree[x]--;
}
int left (int x) {
for (int i = x; i >= 1; i--) if (tree[i]) return i;
return -1;
}
int right (int x) {
for (int i = x + 1; i < 2 * MAXN; i++) if (tree[i]) return i;
return -1;
}
bool empty (int x) {
bool flag = 0; for (int i = 1; i < 2 * MAXN; i++) flag |= tree[i];
return !flag;
}
/* void add (int l, int r, int a, int node) {
if (l == r) {
tree[node] = 1; return;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

tourism.cpp: In function 'int main()':
tourism.cpp:170:6: warning: unused variable 'l' [-Wunused-variable]
  170 |  int l = queries[1][0], r = queries[1][1];
      |      ^
tourism.cpp:170:25: warning: unused variable 'r' [-Wunused-variable]
  170 |  int l = queries[1][0], r = queries[1][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...