이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "park.h"
#include <bits/stdc++.h>
using namespace std;
static int Place[1400];
void strat1(int N) {
for(int i=0;i<N;i++) {
for(int j=i+1;j<N;j++) {
Place[i]=Place[j]=1;
if(Ask(i,j,Place))Answer(i,j);
Place[i]=Place[j]=0;
}
}
}
void strat2(int N) {
vector<int> order = {0,N-1};
for(int i=0;i<N;i++)Place[i]=1;
for(int i=1;i<N-1;i++) {
int pos = 0;
Place[i]=0;
for(int jump=1024;jump;jump/=2) {
if(pos+jump>=order.size())continue;
if(Ask(0,order[pos+jump],Place))pos+=jump;
}
Place[i]=1;
order.emplace(order.begin()+pos+1,i);
}
for(int i=0;i<N;i++)Place[i]=0;
for(int i=1;i<N;i++)Answer(min(order[i],order[i-1]),max(order[i],order[i-1]));
}
void Detect(int T, int N) {
if(T==1)strat1(N);
else if(T==2)strat2(N);
}
컴파일 시 표준 에러 (stderr) 메시지
park.cpp: In function 'void strat2(int)':
park.cpp:24:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
24 | if(pos+jump>=order.size())continue;
| ~~~~~~~~^~~~~~~~~~~~~~
# | 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... |