제출 #1139307

#제출 시각아이디문제언어결과실행 시간메모리
1139307mychecksedad게임 (IOI14_game)C++17
15 / 100
2 ms584 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; #define ll long long int #define MOD (1000000000+7) #define MOD1 (998244353) #define pb push_back #define all(x) x.begin(), x.end() #define en cout << '\n' #define ff first #define ss second #define pii pair<int,int> #define vi vector<int> const int N = 1500+100, M = 1e5+10, K = 52, MX = 30; vector<int> c; bitset<N> b[N]; int x = 0, nn = 0; void initialize(int n) { c.resize(n, n-1); x = 0; nn =n; for(int j = 0 ;j < n; ++j) b[j][j] = 1; } map<pii, bool> co; void apply(int u){ if(c[u] == 1){ for(int j = 0; j < nn; ++j) if(b[u][j] == 0){ co[{u, j}] = 1; co[{j, u}] = 1; --c[j]; --c[u]; b[u][j] = 1; b[j][u] = 1; apply(j); } } } int hasEdge(int u, int v) { if(!co[{u, v}]){ --c[u], --c[v]; b[u][v] = 1; b[v][u] = 1; } // cout << c[u] << ' ' << c[v] << ' '; // for(int j = 0; j < nn; ++j) cout << c[j] << ' '; apply(u); apply(v); if(co[{u, v}]) return 1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...