# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
35839 | funcsr | Building Bridges (CEOI17_building) | C++14 | 666 ms | 23176 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 <vector>
#include <queue>
#include <string>
#include <set>
#include <cassert>
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(xs) xs.begin(), xs.end()
#define INF (1LL<<60)
#define _1 first
#define _2 second
using namespace std;
typedef pair<int, long long> P;
P operator -(const P &a, const P &b) { return P(a._1-b._1, a._2-b._2); }
inline long long det(P a, P b) { return 1LL*a._1*b._2 - 1LL*a._2*b._1; }
int N;
int H[100000], W[100000];
long long dp[1000001];
long long f[1000001];
set<int> ps;
inline P get(int x) { return P(x, f[x]); }
bool is_all_convex() {
vector<P> xs;
for (int x : ps) xs.push_back(P(x, f[x]));
rep(i, (int)xs.size()-2) {
if (det(xs[i+1]-xs[i], xs[i+2]-xs[i]) <= 0) return false;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |