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;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<ii> vii;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define RE(a,b) REP(a,0,b)
#define RE1(a,b) REP(a,1,b+1)
#define FOR(a,b) for(auto& a : b)
#define pb push_back
#define fi first
#define se second
#define all(a) a.begin(), e.end()
int n;
int cnt[1600];
bool unused[1600][1600];
bool big[1600];
void initialize(int N) {
n = N;
RE(i,n) cnt[i] = 1;
RE(i,n) RE(j,n) unused[i][j] = 1;
RE(i,n) unused[i][i] = 0;
RE(i,n) big[i] = 0;
cnt[0] = 0;
big[0] = 1;
}
int hasEdge(int u, int v) {
unused[u][v] = unused[v][u] = 0;
if(big[v])
swap(u,v);
if(big[u]) {
cnt[v]--;
if(cnt[v] == 0) {
big[v] = 1;
RE(i,n)if(unused[i][v]) cnt[i]++;
return 1;
}
}
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... |