이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define all(V) (V).begin(), (V).end()
#define unq(V) (V).resize(unique(all(V))-(V).begin())
using namespace std;
typedef long long ll;
typedef vector<ll> vlm;
typedef vector<int> vim;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
struct node {
int A[2], B[2];
vim V[2][2];
}st[1<<20];
void upd(int n, int s, int e, vim &A, vim &B) {
for (int i=0; i<4; i++) st[n].V[(i/2)&1][i&1].resize(e-s+1);
if (s==e) return ;
int md=(s+e)/2;
upd(n*2, s, md, A, B); upd(n*2+1, md+1, e, A, B);
}
int main() {
cin.tie(0)->sync_with_stdio(0);
int N; vim A(N*2), B(N*2);
cin>>N;
for (auto &i:A) cin>>i;
for (auto &i:B) cin>>i;
upd(1, 0, N*2-1, A, B);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |