# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
211888 | jk89 | Building 4 (JOI20_building4) | C++14 | 4 ms | 384 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 <cstdio>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
#define f first
#define s second
const int MAXN = 1e6 + 3;
const int INF = 1e9 + 3;
int t[MAXN][2];
pair<int, int> dp[MAXN][2];
bool ans[MAXN];
int a = 0, b = 0, akt;
bool possible(int wym, int ind) {
if (dp[ind][wym].f == INF)
return false;
if (t[ind][wym] > t[ind + 1][akt])
return false;
return b - a >= dp[ind][wym].f && b - a <= dp[ind][wym].s;
}
void check(int wym, int ind) {
if (abs(dp[ind][wym].f - INF) == 1)
dp[ind][wym].f = INF;
if (abs(dp[ind][wym].s + INF) == 1)
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |