Submission #1062160

#TimeUsernameProblemLanguageResultExecution timeMemory
1062160andrei_iorgulescu게임 (IOI14_game)C++14
0 / 100
1 ms344 KiB
#include <bits/stdc++.h>
#include "game.h"
#warning That's not FB, that's my FB

using namespace std;

int n;
int sz[1505], t[1505], nre[1505];

void initialize(int N)
{
    n = N;
    for (int i = 1; i <= n; i++)
        t[i] = i, sz[i] = 1, nre[i] = 0;
}

int par(int x)
{
    if (x == t[x])
        return x;
    return par(t[x]);
}

void join(int u, int v)
{
    u = par(u);
    v = par(v);
    if (u == v)
    {
        nre[u]++;
        return;
    }
    if (sz[u] < sz[v])
        swap(u,v);
    sz[u] += sz[v];
    nre[u] += nre[v] + 1;
    t[v] = u;
}

int hasEdge(int u, int v)
{
    u++;
    v++;
    join(u,v);
    int xx = par(u);
    if (nre[xx] == sz[xx] * (sz[xx] - 1) / 2)
        return 1;
    return 0;
}

Compilation message (stderr)

game.cpp:3:2: warning: #warning That's not FB, that's my FB [-Wcpp]
    3 | #warning That's not FB, that's my FB
      |  ^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...