Submission #1043730

#TimeUsernameProblemLanguageResultExecution timeMemory
1043730MalixGame (IOI14_game)C++14
100 / 100
771 ms66728 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vii; typedef pair<int,int> pi; typedef vector<pi> pii; typedef tuple<int,int,int> tii; typedef vector<ll> li; typedef vector<li> lii; #define REP(i,a,b) for(int i=a;i<b;i++) #define F first #define S second #define PB push_back #define MP make_pair #define LSOne(s) ((s)&(-s)) ll INF=1e18+10; int inf=1e9+10; ll M=1e9+7; int n; vector<set<int>> a; vi p; void initialize(int N) { n=N; a.resize(n);p.resize(n); REP(i,0,n)REP(j,0,i)a[i].insert(j); REP(i,1,n)p[i]=i-1; p[0]=0; } int hasEdge(int u, int v) { if(u<v)swap(u,v); if(p[u]!=v){ a[u].erase(v); return 0; } for(auto k:a[u])if(k!=v){ p[u]=k; a[u].erase(v); return 0; } return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...