QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#556844#141. 8 染色Arghariza0 24ms29892kbC++141.7kb2024-09-10 21:25:212024-09-10 21:25:22

Judging History

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

  • [2024-09-10 21:25:22]
  • 评测
  • 测评结果:0
  • 用时:24ms
  • 内存:29892kb
  • [2024-09-10 21:25:21]
  • 提交

Alice

#include "Alice.h"
#include <bits/stdc++.h>
#define eb emplace_back
#define mt make_tuple
#define mp make_pair
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> arr;

namespace A {
	const int N = 2e5 + 5;
	int d[N];
	
	arr Alice(int n, int m, arr u, arr v, arr c) {
		arr res;
		for (int i = 0; i < m; i++) d[u[i]]++, d[v[i]]++;
		for (int i = 0; i < n; i++) res.eb((c[i] >> 1) & 1), res.eb(c[i] >> 2);
		// for (int i = 0; i < n; i++) if (d[i] >= 8) res.eb((c[i] >> 1) & 1), res.eb(c[i] >> 2);
		return res;
	}
}

arr Alice(int n, int m, arr u, arr v, arr c) {
	return A::Alice(n, m, u, v, c);
}

Bob

#include "Bob.h"
#include <bits/stdc++.h>
#define eb emplace_back
#define mt make_tuple
#define mp make_pair
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef tuple<int, int, int> tu;
typedef vector<int> arr;

namespace B {
	const int N = 2e5 + 5;
	int c[N], d[N], vs[N], vis[N];
	vector<int> g[N];
	
	void dfs(int u) {
		vis[u] = 1;
		for (int v : g[u]) {
			if (!vs[v] || vis[v] || (c[u] >> 1) != (c[v] >> 1)) continue;
			c[v] = c[u] ^ 1, dfs(v);
		}
	}
	
	arr Bob(int n, int m, arr u, arr v, arr x) {
		for (int i = 0; i < m; i++) {
			int x = u[i], y = v[i];
			d[x]++, d[y]++, g[x].eb(y), g[y].eb(x);
		}
		for (int i = 0, j = 0; i < n; i++)
			// if (d[i] >= 8)
				vs[i] = 1, c[i] = x[j] | (x[j + 1] << 1), j++;
		for (int i = 0; i < n; i++)
			if (vs[i] && !vis[i]) dfs(i);
		arr res;
		for (int i = 0; i < n; i++) res.eb(c[i]);
		return res;
	}
}

arr Bob(int n, int m, arr u, arr v, arr x) {
	return B::Bob(n, m, u, v, x);
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 24ms
memory: 29892kb

input:

10000 500000
5247 482
4774 3796
5245 9386
8794 2818
1911 3240
6925 6008
6313 1737
8668 4913
7892 5444
6740 2271
2100 53
8527 9605
4009 4765
5293 2683
6552 1326
8877 9929
402 9849
8664 6893
1998 7305
155 9477
9753 8036
448 5438
8535 3111
9493 406
7694 2030
5745 6890
5519 3106
8979 5098
9948 2453
5601...

output:

Success
+100000110110000100001010100000100100110001001111000110001000011010001010110000011111101111101011001001010101100011011100110011011010000110011110101010101110100010010111001101111011000101000010010000101011001110101001100011000111101101010111110000110100110110101001000011011101000110010011111...

input:

10000 500000
5247 482
4774 3796
5245 9386
8794 2818
1911 3240
6925 6008
6313 1737
8668 4913
7892 5444
6740 2271
2100 53
8527 9605
4009 4765
5293 2683
6552 1326
8877 9929
402 9849
8664 6893
1998 7305
155 9477
9753 8036
448 5438
8535 3111
9493 406
7694 2030
5745 6890
5519 3106
8979 5098
9948 2453
5601...

output:

Success
1 1 1 0 0 2 2 1 3 2 0 0 1 1 3 0 0 0 1 2 1 3 1 2 0 0 0 0 1 2 1 1 2 1 0 3 2 1 0 1 2 0 0 3 2 2 2 0 0 1 3 3 0 0 1 3 1 0 0 0 2 3 0 3 1 0 0 2 1 3 1 3 3 1 0 1 0 1 2 2 2 3 2 2 1 3 3 2 3 2 1 3 0 2 2 1 0 3 1 0 3 0 3 1 3 0 3 3 1 1 1 3 2 1 3 2 2 1 1 3 3 1 0 3 3 1 2 2 0 2 0 0 0 1 2 2 0 1 2 2 3 3 1 2 1 2 ...

result:

wrong answer the color of the vertex 2136 and 8482 is the same