| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1052829 | juicy | Memory 2 (JOI16_memory2) | C++17 | 1 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
void Solve(int T, int N){
vector<int> cands = {0, 1, 2}, res(2 * N);
vector his(2 * N, vector<int>(2 * N, -1));
auto flip = [&](int i, int j) {
if (his[i][j] != -1) {
return his[i][j];
}
return his[i][j] = his[j][i] = Flip(i, j);
};
auto extract = [&]() {
for (int i = 0; i < cands.size(); ++i) {
int x = flip(cands[i], cands[i == 0]);
bool flg = 1;
for (int j = 0; j < cands.size(); ++j) {
if (i ^ j) {
flg &= x == flip(cands[i], cands[j]);
}
}
if (flg) {
res[cands[i]] = x;
swap(cands[i], cands.back());
break;
}
}
cands.pop_back();
};
for (int i = 3; i < 2 * N; ++i) {
cands.push_back(i);
extract();
}
if (N > 1) {
extract();
}
res[cands[0]] = res[cands[1]] = flip(cands[0], cands[1]);
for (int i = 0; i < 2 * N; ++i) {
for (int j = i + 1; j < 2 * N; ++j) {
if (res[i] == res[j]) {
Answer(i, j, res[i]);
}
}
}
}
컴파일 시 표준 에러 (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... | ||||
