# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
539338 | 1ne | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 543 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
vector<int64_t>extra;
void combine(vector<int64_t>tree1,vector<int64_t>tree2,int64_t node){
/*for (auto x:tree1){
cout<<x<<" ";
}
cout<<" - > ";
for (auto x:tree2){
cout<<x<<" ";
}
cout<<'\n';
*/
extra[node] = max(extra[node*2],extra[node*2 + 1]);
auto right = lower_bound(tree2.begin(),tree2.end(),tree1.back()) - tree2.begin();
while(right>=0){
if (tree2[right]>=tree1.back() || right>=(int)tree2.size()){
--right;
}
else break;
}
if (right>=0){
extra[node] = max(extra[node],tree1.back() + tree2[right]);
}
// if there is a element in right segment which is less than left maximum
}
void build(vector<vector<int64_t>>&tree,vector<int64_t>&arr,int64_t node,int64_t node_low,int64_t node_high){
if (node_low==node_high){
tree[node].push_back(arr[node_low]);
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |