# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
784178 | tvladm2009 | Xylophone (JOI18_xylophone) | C++17 | 80 ms | 856 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "xylophone.h"
using namespace std;
map<pair<int, int>, int> mp;
int ask(int l, int r) {
if (mp.count({l, r}) > 0) {
return mp[{l, r}];
}
int x = query(l, r);
mp[{l, r}] = x;
return x;
}
void solve(int n) {
mp.clear();
int mn = -1, mx = -1;
int low = 1, high = n;
while (low <= high) {
int mid = (low + high) / 2;
if (ask(1, mid) == n - 1) {
mx = mid;
high = mid - 1;
} else {
low = mid + 1;
}
}
low = 1, high = mx - 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |