# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
6997 | Qwaz | Split the sequence (APIO14_sequence) | C++98 | 560 ms | 93684 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 <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair < ll, int > pli;
const int MAX = 100020, CUT = 220;
struct CHT {
int num[MAX];
ll co[MAX], con[MAX];
int top, now;
void init(){
top = 0;
now = 0;
}
void insert(ll nowCo, ll nowCon, int nowNum){
if(top >= 1 && nowCo == co[top-1]){
num[top-1] = nowNum;
return;
}
while(top >= 2 && (con[top-1]-con[top-2])*(co[top-2]-nowCo) >= (nowCon-con[top-2])*(co[top-2]-co[top-1]))
top--;
co[top] = nowCo;
con[top] = nowCon;
num[top] = nowNum;
# | 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... |