# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
564847 | cheissmart | Sightseeing in Kyoto (JOI22_kyoto) | C++14 | 1 ms | 212 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>
#define IO_OP ios::sync_with_stdio(0), cin.tie(0)
#define F first
#define S second
#define V vector
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;
const int INF = 1e9 + 7;
bool check(int a, int b, int c, int d) { // a / b >= c / d ?
assert(b > 0 && d > 0);
return 1. * a / b >= 1. * c / d;
// return 1LL * a * d >= 1LL * b * c;
}
vi go(vi a) {
vi h;
int n = SZ(a);
for(int i = 0; i < n; i++) {
if(SZ(h) >= 2 && check(a[h[SZ(h) - 1]] - a[h[SZ(h) - 2]], h[SZ(h) - 1] - h[SZ(h) - 2], a[i] - a[h[SZ(h) - 1]], i - h[SZ(h) - 1]))
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |