# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
917185 | coding_snorlax | Painting Walls (APIO20_paint) | C++14 | 1513 ms | 18432 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<bits/stdc++.h>
#include "paint.h"
using namespace std;
int segment_tree[800020];
vector<int> color[100002],possible1;
int Total[100002]={0};
int possible_place[100002]={0};
int query(int L,int R,int qL,int qR,int id){
if(qL==L && qR==R) return segment_tree[id];
int M=(L+R)/2;
if(qL>M) return query(M+1,R,qL,qR,2*id+1);
else if(qR<=M) return query(L,M,qL,qR,2*id);
else return max(query(L,M,qL,M,2*id),query(M+1,R,M+1,qR,2*id+1));
}
void modify(int L,int R,int place,int new_num,int id){
//cout<<L<<" "<<R<<endl;
if(L==R){
segment_tree[id]=new_num;
return;
}
int M=(L+R)/2;
if(place>M) modify(M+1,R,place,new_num,2*id+1);
else if(place<=M) modify(L,M,place,new_num,2*id);
segment_tree[id]=max(segment_tree[2*id],segment_tree[2*id+1]);
}
int cal_answer(int M,vector<int> possible){
if(!possible[M-1]) return -1;
int bound = M-1;
int answer = 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |