이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "game.h"
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define pb push_back
#define se second
#define fi first
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int nax=1e5+5;
int N;
set<int> st[nax];
void initialize(int n) {
N=n;
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < n; ++j)
{
if(j==i) continue;
st[i].insert(j);
}
}
}
int hasEdge(int u, int v) {
if(u>v) swap(u,v);
if(st[u].begin()==st[u].lower_bound(v)&&st[u].size()==1){
st[u].erase(v);
st[v].erase(u);
return 1;
}
auto x=*--st[u].lower_bound(v);
st[u].erase(v);
st[v].erase(u);
if(x<u) return 1;
else 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... |