답안 #918011

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
918011 2024-01-29T11:32:19 Z zhasyn 게임 (IOI14_game) C++17
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 block[u][v];
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4444 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4444 KB Output isn't correct
2 Halted 0 ms 0 KB -