Submission #918012

# Submission time Handle Problem Language Result Execution time Memory
918012 2024-01-29T11:33:27 Z zhasyn Game (IOI14_game) C++14
0 / 100
1 ms 4444 KB
#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
using namespace std;
#define F first
#define S second
typedef long long ll;
#define pii pair <int, int>
#define pll pair <ll, ll>
typedef long double ld;
const ll N = 1500 + 10, M = 30;
const ll mod = 998244353;
int g;
bool block[N][N], was[N], pred[N][N];
void initialize(int n){
  g = n;
}
void dfs(int v){
  was[v] = true;
  for(int i = 0; i < g; i++){
    if(was[i] || block[i][v] == true) continue;
    dfs(i);
  }
}
int hasEdge(int u, int v){
  if(pred[u][v]) return block[u][v];
  
  pred[u][v] = pred[v][u] = true;
  block[u][v] = block[v][u] = true;
  dfs(0);
  int cnt = 0;
  for(int i = 0; i < g; i++){
    if(was[i]) cnt++;
  }
  
  if(cnt != g) block[u][v] = block[v][u] = false;
  return 1 - block[u][v];
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4444 KB Output isn't correct
2 Halted 0 ms 0 KB -