| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 937331 | freedommo33 | 카멜레온의 사랑 (JOI20_chameleon) | C++17 | 1 ms | 344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "chameleon.h"
#include <vector>
#include <iostream>
using namespace std;
// Function to find a pair given one of the chameleons
void findPair(int n, int x, vector<bool>& found) {
int low = 1, high = 2 * n, mid;
while (low < high) {
mid = (low + high) / 2;
vector<int> query = {x};
for (int i = 1; i <= mid; ++i) {
if (!found[i]) query.push_back(i);
}
int result = Query(query);
if (result < query.size()) {
high = mid;
} else {
low = mid + 1;
}
}
Answer(x, low);
found[x] = found[low] = true;
}
void Solve(int N) {
vector<bool> found(2 * N + 1, false);
for (int i = 1; i <= 2 * N; ++i) {
if (!found[i]) {
findPair(N, i, found);
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
