| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 867512 | 42kangaroo | popa (BOI18_popa) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//
// Created by 42kangaroo on 28/10/2023.
//
#include "bits/stdc++.h"
#include "popa.h"
using namespace std;
struct Node {
int p, l, r;
};
int solve(int N, int* Left, int* Right) {
int nowN = 0;
vector<Node> no(N, {-1,-1,-1});
for (int i = 1; i < N; ++i) {
if (query(i - 1, i, i - 1, i - 1)) {
no[i].p = i - 1;
no[i - 1].r = i;
}
else {
assert(query(nowN, i, i, i));
no[nowN].p = i;
no[i].l = nowN;
nowN = i;
}
}
for (int i = 0; i < N; ++i) {
Left[i] = no[i].l;
Right[i] = no[i].r;
}
return nowN;
}
int query(int a, int b, int c, int d) {
cout << a << " "<< b << " " << c << " " << d;
int r; cin >> r;
return r;
}
