Submission #946288

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9462882024-03-14 13:22:53JooDdaeThe Potion of Great Power (CEOI20_potion)C++17
38 / 100
3040 ms99120 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define mid ((l+r) >> 1)
struct Node {
int l, r, s;
} pt[20010010];
int pc;
int n, D, h[100100], r[100100];
array<int, 2> p[100100];
vector<pair<int, int>> d[100100];
int update(int u, int id, int val, int l = 0, int r = n-1) {
if(id < l || r < id) return u;
int x = ++pc;
pt[x] = pt[u], pt[x].s += val;
if(l == r) return x;
pt[x].l = update(pt[x].l, id, val, l, mid);
pt[x].r = update(pt[x].r, id, val, mid+1, r);
return x;
}
int find(int u, int id, int l = 0, int r = n-1) {
if(id < l || r < id) return 0;
if(l == r) return pt[u].s;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

potion.cpp: In function 'int question(int, int, int)':
potion.cpp:77:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   77 |     while(x < X.size() && y < Y.size()) {
      |           ~~^~~~~~~~~~
potion.cpp:77:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   77 |     while(x < X.size() && y < Y.size()) {
      |                           ~~^~~~~~~~~~
potion.cpp:72:9: warning: unused variable 'cx' [-Wunused-variable]
   72 |     int cx = pt[rx].s, cy = pt[ry].s;
      |         ^~
potion.cpp:72:24: warning: unused variable 'cy' [-Wunused-variable]
   72 |     int cx = pt[rx].s, cy = pt[ry].s;
      |                        ^~
#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...