제출 #232874

#제출 시각아이디문제언어결과실행 시간메모리
232874kshitij_sodani게임 (IOI14_game)C++17
100 / 100
498 ms25340 KiB
#include <iostream> #include <bits/stdc++.h> #include <game.h> using namespace std; #define a first #define b second #define pb push_back #include "game.h" typedef long long int llo; int vis[1501]; int n; int x=1; int aa[1501][1501]; int par[1501]; int find(int no){ if(par[no]==no){ return no; } par[no]=find(par[no]); return par[no]; } void initialize(int nn){ n=nn; for(int i=0;i<n;i++){ par[i]=i; for(int j=0;j<n;j++){ if(j==i)continue; aa[i][j]=1; } } } int hasEdge(int u, int v){ int ac=find(u); int cc=find(v); if(ac==cc){ return 0; } if(aa[ac][cc]==1){ par[cc]=ac; for(int i=0;i<n;i++){ if(i==ac){ continue; } aa[ac][i]+=aa[cc][i]; aa[i][ac]+=aa[i][cc]; } return 1; } aa[ac][cc]-=1; aa[cc][ac]-=1; return 0; } /*int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); return 0; }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...