# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
68031 | KLPP | Ancient Books (IOI17_books) | C++14 | 2053 ms | 104732 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 "books.h"
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long lld;
typedef pair<int,int> state;
typedef std::map<state,lld>::iterator mi;
int arr[1000000];
int n;
int maxa,maxb;
map<state,lld>DP;
lld computevalue(int i, int j){
//cout<<i<<" "<<j<<endl;
if(i<=maxa && maxb<=j)return 0;
mi it=DP.find(state(i,j));
if(it!=DP.end())return it->second;
int start=i;
int end=j;
int ps=start;
int pe=end;
while(pe<=end){
while(ps>=start){
start=min(start,arr[ps]);
end=max(end,arr[ps]);
ps--;
}
start=min(start,arr[pe]);
end=max(end,arr[pe]);
# | 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... |