# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1123817 | Icelast | Building 4 (JOI20_building4) | C++20 | 355 ms | 69088 KiB |
#include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll maxn = 2*1e5+5, INF = 4e18+9;
struct segment{
int l, r;
};
void solve(){
int n;
cin >> n;
vector<int> a(n*2+1), b(n*2+1);
for(int i = 1; i <= 2*n; i++){
cin >> a[i];
}
for(int i = 1; i <= 2*n; i++){
cin >> b[i];
}
a[0] = 0;
vector<vector<segment>> f(n*2+1, vector<segment>(2, {-1, -1}));
auto merge = [&](segment &a, segment b) -> void{
if(b.l == -1) return;
if(a.l == -1){
a = b;
return;
}
a.l = min(a.l, b.l);
a.r = max(a.r, b.r);
};
f[0][0] = {0, 0};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |