# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
818422 | tengiz05 | Ancient Machine 2 (JOI23_ancient2) | C++17 | 196 ms | 620 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ancient2.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <string>
#include <vector>
using namespace std;
namespace {
} // namespace
std::string Solve(int n) {
int m = n + 2;
std::vector<int> a(m), b(m);
for (int i = 0; i < n - 1; i++) {
a[i] = b[i] = i + 1;
}
string s(n, '?');
for (int i = n - 1; i >= 0; i--) {
a[i] = n;
b[i] = n + 1;
a[n] = b[n] = n;
a[n + 1] = b[n + 1] = n + 1;
int val = Query(m, a, b);
if (val == n) {
s[i] = '0';
} else {
s[i] = '1';
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |