# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
835049 | _martynas | 게임 (IOI14_game) | C++11 | 2 ms | 600 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
const int mxn = 1505;
int n;
int deg[mxn];
bool resp[mxn][mxn];
bool adj[mxn][mxn];
void initialize(int N) {
n = N;
for(int i = 0; i < n; i++) deg[i] = n-1;
}
int hasEdge(int u, int v) {
if(adj[u][v]) return true;
queue<int> q;
deg[u]--; if(deg[u] == 1) q.push(u);
deg[v]--; if(deg[v] == 1) q.push(v);
resp[u][v] = resp[v][u] = true;
while(!q.empty()) {
int i = q.front(); q.pop();
for(int j = 0; j < n; j++) if(i != j && !resp[i][j] && !adj[i][j]) {
adj[i][j] = adj[j][i] = true;
deg[j]--; if(deg[j] == 1) q.push(j);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |