이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "minerals.h"
#include "minerals.h"
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
int last = 0;
void div(vector<int> start, vector<int> end){
int N = start.size();
vector<int> l, r, le, re;
if(N == 1){
Answer(start[0], end[0]);
return;
}
for(int i = 0; i < N/2; i ++){
last = Query(start[i]);
l.push_back(start[i]);
}
for(int i = N/2; i < N; i ++){
r.push_back(start[i]);
}
for(int i = 0; i < N; i ++){
int t = Query(end[i]);
if(t != last){
last = t;
le.push_back(end[i]);
}
else{
Query(end[i]);
re.push_back(end[i]);
}
}
div(le, l);
div(r, re);
}
void Solve(int N) {
vector<int> start, end;
for(int i = 0; i < N * 2; i ++){
int t = start.size();
int ans = Query(i+1);
if(ans == t + 1){
start.push_back(i+1);
}
else{
end.push_back(i+1);
Query(i+1);
}
}
last = N;
div(start, end);
}
# | 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... |
# | 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... |