# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
491476 | Mondeus | Split the sequence (APIO14_sequence) | C++17 | 2083 ms | 125032 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 <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <cassert>
#include <algorithm>
using namespace std;
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("Ofast")
struct CHT
{
vector<int> a;
vector<long long> b;
vector<int> id;
bool cross(int i, int j, int k)
{
return (b[k] - b[i]) * (a[j] - a[i]) >= (b[j] - b[i]) * (a[k] - a[i]);
}
void add(long long A, long long B, long long ID)
{
a.push_back(A);
b.push_back(B);
id.push_back(ID);
while(a.size() > 2 && cross(a.size()-3,a.size()-2,a.size()-1))
{
a.erase(a.end()-2);
b.erase(b.end()-2);
id.erase(id.end()-2);
}
# | 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... |