# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
969542 | willychan | Real Mountains (CCO23_day1problem2) | C++17 | 2478 ms | 135580 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>
using namespace std;
typedef long long llo;
//#include<bits/extc++.h>
//__gnu_pbds
const int MOD = 1e6+3;
/*
mantain a set of in process elements
repeatly remove elements from the leftmost or the rightmost side for which there doesn't exist a i<j<k such that hi>hj<hk
if(cnt>=2):
check for 4 number ll lr rl rr
some inequality
rl <= ll
lr <= rr
pick the smallest of rl,lr M
than suppose the current height is h, and there are cnt element in my set
let L = (M-h)
ans+= L(ll+M+rr+2*cnt-3)+(3*cnt-4)*(L*(h+M-1))/2;
h = M;
else:
find 2 numbers l, r
WLOG l<=r
ans += (h+l-1)(l-h)/2 + (l+r)(l-h)
*/
struct SEG{
vector<int> arr;
int n;
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |