제출 #1345560

#제출 시각아이디문제언어결과실행 시간메모리
1345560somefolk게임 (IOI14_game)C++20
0 / 100
1 ms344 KiB
#include <bits/stdc++.h>
using namespace std;

const int N = 1500;
int n, rest;
vector<int> cnt;

void initialize(int _n){
    n = _n;
    rest = n*(n-1)/2;
    cnt.resize(n);
}

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