Submission #422488

#TimeUsernameProblemLanguageResultExecution timeMemory
422488flappybirdGame (IOI14_game)C++14
15 / 100
1 ms332 KiB
#include "game.h" #include <bits/stdc++.h> #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx,avx2,fma") using namespace std; typedef int ll; #define MAX 1900 ll N; ll p[MAX]; ll line[MAX][MAX]; ll num[MAX]; ll find(ll x) { if (x == p[x]) return x; return p[x] = find(p[x]); } void uni(ll x, ll y) { x = find(x); y = find(y); ll i; p[y] = x; num[x] += num[y]; for (i = 0; i < N; i++) if (i != x && i != y) line[i][x] += line[i][y]; } void initialize(int n) { N = n; ll i, j; for (i = 0; i < N; i++) p[i] = i, num[i] = 1; } int hasEdge(int u, int v) { u = find(u); v = find(v); if (u == v) return 1; if (line[u][v] == num[u] * num[v] - 1) { uni(u, v); return 1; } line[u][v]++; line[v][u]++; return 0; }

Compilation message (stderr)

game.cpp: In function 'void initialize(int)':
game.cpp:34:8: warning: unused variable 'j' [-Wunused-variable]
   34 |  ll i, j;
      |        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...