| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|
| 1300383 | | vtnoo | 게임 (IOI14_game) | C++20 | | 209 ms | 16024 KiB |
#include "game.h"
#include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,pao=b;i<pao;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int MAXN=1505;
int N,S[MAXN][MAXN],R[MAXN];
vector<int>cmp[MAXN];
void initialize(int n) {
N=n;
fore(i,0,n){
R[i]=i;
cmp[i].pb(i);
fore(j,0,n){
if(i!=j)S[i][j]=1;
}
}
return;
}
int hasEdge(int u, int v) {
int a=R[u], b=R[v];
if(a==b)return 0;
if(S[a][b]==1){
if(SZ(cmp[a])<SZ(cmp[b])){
swap(a,b);
}
for(auto x:cmp[b]){
cmp[a].pb(x);
R[x]=a;
}
cmp[b].clear();
fore(i,0,N){
if(i==a)continue;
S[a][i]+=S[b][i];
S[i][a]=S[a][i];
S[i][b]=0;
S[b][i]=0;
}
return 1;
}else{
S[a][b]--;
S[b][a]--;
return 0;
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |