# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
245745 | mikoarm | 자리 배치 (IOI18_seats) | C++14 | 4081 ms | 69940 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "seats.h"
using namespace std;
struct Tree {
vector<int> mins, maxs;
int B;
Tree(){}
Tree(vector<int> R) {
B = 1;
while (B < (int)R.size()) {
B *= 2;
}
maxs.resize(2*B), mins.resize(2*B);
for (int i = B; i < B + (int)R.size(); i++) mins[i] = R[i-B], maxs[i] = R[i-B];
for (int i = B-1; i >= 1; i--) maxs[i] = max(maxs[2*i], maxs[2*i+1]), mins[i] = min(mins[2*i], mins[2*i+1]);
}
pair<int,int> query(int a, int b) {
a += B;
b += B;
pair<int,int> ret = {max(maxs[a], maxs[b]), min(maxs[a], maxs[b])};
while (a / 2 != b / 2) {
if (a % 2 == 0) ret.first = max(ret.first, maxs[a+1]), ret.second = min(ret.second, mins[a+1]);
if (b % 2 == 1) ret.first = max(ret.first, maxs[b-1]), ret.second = min(ret.second, mins[b-1]);
a /= 2; b /= 2;
}
return ret;
}
void update(int a) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |