제출 #659359

#제출 시각아이디문제언어결과실행 시간메모리
659359Do_you_copyGame (IOI14_game)C++17
15 / 100
1 ms292 KiB
/*
    I find it wholesome to be alone the greater part of the time.
    To be in company, even with the best, is soon wearisome and dissipating.
    I love to be alone.
    I never found the companion that was so companionable as solitude.
*/
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define faster ios_base::sync_with_stdio(0); cin.tie(0);
#include "game.h"
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair <int, int>;
const int maxN = 1e5 + 1;
//const int Mod = 1e9 + 7;
//const int inf =
int n;
int cnt[maxN];
int m;
int c;
int req;
void initialize(int _n){
    n = _n;
    m = n * (n - 1) / 2;
    req = n - 1;
}

int hasEdge(int u, int v){
    ++c;
    ++cnt[u];
    ++cnt[v];
    if (c > m - req || cnt[u] == n - 1 || cnt[v] == n - 1){
        --req;
        return 1;
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...