# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
642544 | danikoynov | 게임 (APIO22_game) | C++17 | 2725 ms | 119544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
const int maxk = 5010, maxn = 30010;
vector < int > g[maxn];
int used[maxk][maxn], tf, K;
void add_edge(int i, int u, int v)
{
if (used[i][u] == 0)
return;
if (used[i][v])
{
if (v <= i)
tf = 1;
return;
}
queue < int > q;
q.push(v);
used[i][v] = 1;
while(!q.empty())
{
int cur = q.front();
///cout << i << " :: " << cur << endl;
q.pop();
if (cur <= i)
tf = 1;
for (int nb : g[cur])
{
if (used[i][nb] == 0)
{
used[i][nb] = 1;
q.push(nb);
}
else
if (nb <= i)
tf = 1;
}
}
}
void init(int n, int k)
{
K = k;
for (int i = 0; i < k; i ++)
for (int j = i; j < k; j ++)
used[i][j] = 1;
}
int add_teleporter(int u, int v)
{
g[u].push_back(v);
for (int i = 0; i < K; i ++)
{
add_edge(i, u, v);
}
return tf;
}
컴파일 시 표준 에러 (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... |