제출 #1299208

#제출 시각아이디문제언어결과실행 시간메모리
1299208martin_011Game (IOI14_game)C++20
0 / 100
1 ms340 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define vi vector<int> #define vll vector<ll> #define str string #define vd void #define vb vector<bool> #define F first #define S second #define lbr '\n' #define all(x) x.begin(), x.end() const ll INF = 1E15; const ll mod = 1000000007; vector<vll> g; vb v; ll n; ll dfs(ll a) { if (v[a]) return 0; v[a] = 1; ll r = 1; for (int i=0; i<n; i++) { if (g[a][i]) r += dfs(i); } return r; } void initialize(int N) { n = N; g.assign(n, vll(n, 1)); for (int i=0; i<n; i++) g[i][i]=0; } int hasEdge(int x, int y) { v.assign(n, 0); g[x][y] = 0; g[y][x] = 0; ll d = dfs(1); cout<<d<<lbr; if (d == n) return 0; else { g[x][y] = 1; g[y][x] = 1; return 1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...