Submission #422360

#TimeUsernameProblemLanguageResultExecution timeMemory
422360flappybirdGame (IOI14_game)C++14
0 / 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 mp[MAX][MAX]; ll vis[MAX]; ll N; queue<ll> q; void bfs(ll x) { ll i; q.push(x); ll v; while (!q.empty()) { v = q.front(); q.pop(); if (vis[v]) continue; vis[v] = 1; for (i = 1; i <= N; i++) if (mp[v][i] && !vis[i]) q.push(i); } } void initialize(int n) { N = n; ll i, j; for (i = 0; i < n; i++) for (j = 0; j < n; j++) mp[i][j] = 1; } int hasEdge(int u, int v) { ll i; while (!q.empty()) q.pop(); for (i = 0; i < N; i++) vis[i] = 0; mp[u][v] = 0; mp[v][u] = 0; bfs(u); if (vis[v]) return 0; else mp[u][v] = 1, mp[v][u] = 1; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...