Submission #501713

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5017132022-01-04 10:52:20amunduzbaevMonster Game (JOI21_monster)C++17
100 / 100
104 ms536 KiB
#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++]);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...