This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0;i<n;++i)
#define pb push_back
const int N=1500;
int ord[N];
int vis[N];
int cnt[N];
int z=0;
int n;
void initialize(int _n) {
n=_n;
}
int hasEdge(int u, int v) {
if (!vis[u]) {
vis[u]=1;
ord[u]=z++;
cnt[u]=ord[u];
}
swap(u,v);
if (!vis[u]) {
vis[u]=1;
ord[u]=z++;
cnt[u]=ord[u];
}
if (ord[u]>ord[v]) swap(u,v);
if (cnt[v]>1) {
--cnt[v]; return 0;
}
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |