# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
501713 | amunduzbaev | Monster Game (JOI21_monster) | C++17 | 104 ms | 536 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "monster.h"
#ifndef EVAL
#include "grader.cpp"
#endif
using namespace std;
bool qq(int a, int b) {
return Query(a, b);
}
vector<int> Solve(int n) {
function<vector<int>(int, int)> merge = [&](int l, int r){
if(l == r) return vector<int>{l};
int m = (l + r) >> 1;
vector<int> lx = merge(l, m), rx = merge(m+1, r), res;
l = 0, r = 0;
while(l < (int)lx.size() || r < (int)rx.size()){
if(l < (int)lx.size() && r < (int)rx.size()){
//~ cout<<rx[r]<<" "<<lx[l]<<"\n";
if(qq(lx[l], rx[r])) res.push_back(rx[r++]);
else res.push_back(lx[l++]);
} else if(l < (int)lx.size()){
res.push_back(lx[l++]);
} else {
res.push_back(rx[r++]);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |