QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#121692#1148. Gamevalerikk#0 0ms3688kbC++17703b2023-07-08 18:06:362024-07-04 00:31:49

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 00:31:49]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3688kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-08 18:06:36]
  • 提交

answer

#include "game.h"
#include <bits/stdc++.h>

using namespace std;

namespace {

const int N = 85;

int n;
int p[N];
int e[N][N];

void merge(int v, int u) {
	v = p[v];
	u = p[u];
	for (int i = 0; i < n; ++i) {
		if (p[i] == v) {
			p[i] = u;
		}
	}
}

}

void initialize(int n1) {
	n = n1;
	for (int i = 0; i < n; ++i) {
		p[i] = i;
	}
	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; ++j) {
			e[i][j] = 1;
		}
	}
}

int hasEdge(int u, int v) {
	int cnt = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; ++j) {
			if (min(p[v], p[u]) == min(p[i], p[j]) && max(p[v], p[u]) == max(p[i], p[j])) {
				++cnt;
			}
		}
	}
	if (cnt == 1) {
		merge(v, u);
		return 1;
	}
	return 0;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3560kb

input:

4
0 1
3 0
1 2
0 2
3 1
2 3

output:

1
0
0
0
0
1

result:

wrong answer not correct

Subtask #2:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 0ms
memory: 3560kb

input:

4
0 1
3 0
1 2
0 2
3 1
2 3

output:

1
0
0
0
0
1

result:

wrong answer not correct

Subtask #3:

score: 0
Wrong Answer

Test #79:

score: 0
Wrong Answer
time: 0ms
memory: 3688kb

input:

4
0 1
3 0
1 2
0 2
3 1
2 3

output:

1
0
0
0
0
1

result:

wrong answer not correct