# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
94337 | fedoseevtimofey | Xylophone (JOI18_xylophone) | C++14 | 392 ms | 424 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "xylophone.h"
#include "bits/stdc++.h"
using namespace std;
int my_query(int l, int r, vector <int> &a) {
int mx = -1e9, mn = 1e9;
for (int i = l; i <= r; ++i) {
mx = max(mx, a[i]);
mn = min(mn, a[i]);
}
return mx - mn;
}
void solve(int n) {
vector <int> a(n + 1);
a[1] = 0;
a[2] = query(1, 2);
for (int i = 3; i <= n; ++i) {
int x = query(i - 2, i);
int y = query(i - 1, i);
for (int z = -n; z <= n; ++z) {
a[i] = z;
if (my_query(i - 2, i, a) == x && my_query(i - 1, i, a) == y) {
break;
}
}
}
int mn = 1e9;
for (int i = 1; i <= n; ++i) mn = min(mn, a[i]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |