Submission #171477

#TimeUsernameProblemLanguageResultExecution timeMemory
171477gs18103Game (IOI14_game)C++14
0 / 100
2 ms376 KiB
#include "game.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define em emplace
#define all(v) v.begin(), v.end()
#define report(x, l, s) stype[x] = s, location[x] = l, chk[x] = true

using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int MAX = 2020;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;

bool chk[MAX];
int cnt[MAX];

void initialize(int n) {
    for(int i = 0; i < n; i++) cnt[i] = n - 1;
}

int hasEdge(int u, int v) {
    cnt[u]--, cnt[v]--;
    if(chk[v] || chk[u]) return 0;
    if(cnt[u] == 0 || cnt[v] == 0) {
        chk[u] = chk[v] = true;
        return 1;
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...