# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
337101 | rocks03 | Building 4 (JOI20_building4) | C++14 | 0 ms | 0 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.
//#pragma GCC target("avx2")
//#pragma GCC optimization("O3")
//#pragma GCC optimization("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define pb push_back
#define SZ(x) ((int)(x).size())
#define all(x) x.begin(), x.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MAXN = 1e6+100;
int N, a[MAXN], b[MAXN];
struct state{
bool good = false;
int l[2] = {MAXN, MAXN}, r[2] = {-1, -1};
} dp[2][MAXN];
void solve(){
cin >> N;
N = 2 * N;
for(int i = 0; i < N; i++){
cin >> a[i];
}
for(int i = 0; i < N; i++){
cin >> b[i];