# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
5691 | cki86201 | UFO (IZhO14_ufo) | C++98 | 1719 ms | 76260 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#include<vector>
using namespace std;
vector<vector <int> > inp;
int N, M, R, K, P;
struct node{
node(){v=x=0,link[0]=link[1]=0;}
int v, x;
node *link[2];
inline void pushup(){
x = max(v, max(link[0] ? link[0]->x : 0, link[1] ? link[1]->x : 0));
}
void build(int xy,int cl,int s,int d){
int m = (s+d) >> 1;
v = (xy ? inp[m][cl] : inp[cl][m]);
if(s<m){
link[0] = new node();
link[0]->build(xy, cl, s, m-1);
}
if(m<d){
link[1] = new node();
link[1]->build(xy, cl, m+1, d);
}
pushup();
}
void update(int w,int s,int d){
int m = (s+d)>>1;
if(w == m)--v;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |