# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1127691 | khanhphucscratch | Building 4 (JOI20_building4) | C++20 | 216 ms | 26012 KiB |
#include<bits/stdc++.h>
using namespace std;
pair<int, int> dp[1000005][2];
int a[1000005], b[1000005];
pair<int, int> add1(pair<int, int> x)
{
x.first++; x.second++; return x;
}
pair<int, int> unite(pair<int, int> x, pair<int, int> y)
{
//It could be unite, trust me bro
if(x.first < 0) return y;
if(y.first < 0) return x;
return make_pair(min(x.first, y.first), max(x.second, y.second));
}
bool contain(pair<int, int> y, int x)
{
return (y.first <= x && x <= y.second);
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n; cin>>n;
n *= 2;
for(int i = 1; i <= n; i++) cin>>a[i];
for(int i = 1; i <= n; i++) cin>>b[i];
for(int i = 1; i <= n; i++) dp[i][0] = dp[i][1] = make_pair(-1e9, -1e9);
dp[1][1] = {1, 1}, dp[1][0] = {0, 0};
for(int i = 1; i < n; i++){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |