# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
93439 | popovicirobert | Swap (BOI16_swap) | C++14 | 40 ms | 4468 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define ld long double
// 217
// 44
using namespace std;
const int INF = 1e9;
const int MAXN = (int) 1e5;
int arr[3 * MAXN + 1];
map < pair <int, int>, int > mp;
int solve(int pos, int val) {
if(mp.count({pos, val})) {
return mp[{pos, val}];
}
if(val < min(arr[2 * pos], arr[2 * pos + 1])) {
return pos;
}
if(arr[2 * pos] < arr[2 * pos + 1]) {
return mp[{pos, val}] = solve(2 * pos, val);
}
int mn = min(arr[2 * pos], val);
// b c a
if(solve(2 * pos, mn) < solve(2 * pos + 1, mn)) {
# | 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... |