# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954746 | abczz | Building 4 (JOI20_building4) | C++14 | 5 ms | 7004 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 <array>
#include <algorithm>
#include <queue>
#define ll long long
#define ld long double
using namespace std;
bool visited[1000000][2], X[1000000][2], B[1000000];
string S;
vector <array<ll, 2>> V, R;
ll n, s, k, p, x, mn, mx, A[1000000][2], cnt[1000000];
void dfs(ll u, ll x) {
visited[u][x] = 1;
if (u == n-1) {
X[u][x] = 1;
return;
}
if (A[u][x] <= A[u+1][0]) {
if (!visited[u+1][0]) dfs(u+1, 0);
X[u][x] |= X[u+1][0];
}
if (A[u][x] <= A[u+1][1]) {
if (!visited[u+1][1]) dfs(u+1, 1);
X[u][x] |= X[u+1][1];
}
}
int main() {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |