제출 #918013

#제출 시각아이디문제언어결과실행 시간메모리
918013zhasyn게임 (IOI14_game)C++14
0 / 100
1 ms4444 KiB
#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++;
    was[i] = false;
  }
  
  if(cnt != g) block[u][v] = block[v][u] = false;
  return block[u][v];
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...