| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 982890 | raphaelp | Island Hopping (JOI24_island) | C++17 | 7 ms | 1128 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "island.h"
using namespace std;
vector<vector<int>> dist;
/*int query(int x, int k)
{
return dist[x - 1][k] + 1;
}
void answer(int a, int b)
{
cout << a << ' ' << b << endl;
}*/
void solve(int N, int L)
{
vector<vector<int>> AR(N);
vector<int> occ(N);
for (int i = N - 1; i >= 0; i--)
{
if (occ[i])
continue;
occ[i] = 1;
vector<int> occ2(N);
for (int k = 1; k < N; k++)
{
int x = query(i + 1, k) - 1;
if (occ2[x])
break;
AR[i].push_back(x);
if (!occ[x])
{
for (int j = 1; j < N; j++)
{
int y = query(x + 1, j) - 1;
AR[x].push_back(y);
if (y == i)
break;
}
occ[x] = 1;
}
for (int j = 0; j < AR[AR[i][k - 1]].size(); j++)
{
occ2[AR[AR[i][k - 1]][j]] = 1;
}
}
}
for (int i = 0; i < N; i++)
{
for (int j = 0; j < AR[i].size(); j++)
{
if (AR[i][j] < i)
answer(AR[i][j] + 1, i + 1);
}
}
}
/*int main()
{
int N, L;
cin >> N >> L;
vector<vector<int>> AR(N);
for (int i = 0; i < N - 1; i++)
{
int a, b;
cin >> a >> b;
a--, b--;
AR[a].push_back(b);
AR[b].push_back(a);
}
dist.assign(N, vector<int>(N, 0));
for (int i = 0; i < N; i++)
{
vector<int> occ(N);
priority_queue<pair<int, int>> PQ;
int buff = 0;
PQ.push({0, -i});
while (!PQ.empty())
{
int x = -PQ.top().second, t = -PQ.top().first;
PQ.pop();
if (occ[x])
continue;
occ[x] = 1;
dist[i][buff++] = x;
for (int j = 0; j < AR[x].size(); j++)
{
PQ.push({-(t + 1), -AR[x][j]});
}
}
}
solve(N, L);
}*/컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
