답안 #642546

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
642546 2022-09-19T21:47:47 Z danikoynov 게임 (APIO22_game) C++17
0 / 100
1 ms 976 KB
#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 < 1; 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 < 1; i ++)
    {
        add_edge(i, u, v);
    }
    return tf;
}

Compilation message

game.cpp: In function 'void add_edge(int, int, int)':
game.cpp:31:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   31 |         if (cur <= i)
      |         ^~
game.cpp:33:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   33 |             for (int nb : g[cur])
      |             ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 976 KB Output is correct
2 Incorrect 1 ms 976 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 976 KB Output is correct
2 Incorrect 1 ms 976 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 976 KB Output is correct
2 Incorrect 1 ms 976 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 976 KB Output is correct
2 Incorrect 1 ms 976 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 976 KB Output is correct
2 Incorrect 1 ms 976 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -