# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
989637 | canadavid1 | Ancient Machine 2 (JOI23_ancient2) | C++17 | 149 ms | 1556 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ancient2.h"
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
namespace {
int variable_example = 1;
} // namespace
std::string Solve(int N) {
// query one bit:
// a[i], b[i] = i+1
// a[b] = 1000
// b[b] = 1001
// a,b[1001] = 1001
// a,b[1000] = 1000
std::vector<int> a(N+2);
std::iota(a.begin(),a.begin()+N,1);
a[N] = N;
a[N+1] = N+1;
auto b = a;
std::string s;
for(int i = 0; i < N; i++)
{
a[i] = N;
b[i] = N+1;
s.push_back((Query(N+2,a,b)>N) ? '1' : '0');
a[i] = i+1;
b[i] = i+1;
}
return s;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |