# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48169 | tmwilliamlin168 | Split the sequence (APIO14_sequence) | C++14 | 892 ms | 84280 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;
#define ll long long
const int mxN=1e5;
int n, k, prv[201][mxN+1], qh, qt;
ll ps[mxN+1], dp[2][mxN+1], a[mxN+1], b[mxN+1], c[mxN+1];
inline void al(ll ai, ll bi, ll ci) {
if(qt-qh>=1&&a[qt-1]==ai) {
if(bi<b[qt-1])
--qt;
else
return;
}
while(qt-qh>=2&&(b[qt-1]-b[qt-2])/(a[qt-2]-a[qt-1])>=(bi-b[qt-1])/(a[qt-1]-ai))
--qt;
a[qt]=ai;
b[qt]=bi;
c[qt]=ci;
++qt;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k;
for(int i=0; i<n; ++i)
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... |