QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90089#141. 8 染色Illusory_dimesCompile Error//C++172.9kb2023-03-22 12:05:232023-03-22 12:05:27

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-22 12:05:27]
  • 评测
  • [2023-03-22 12:05:23]
  • 提交

Alice

#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;

#define File(a) freopen(a".in", "r", stdin), freopen(a".out", "w", stdout)
#define Check(a) freopen(a".in", "r", stdin), freopen(a".ans", "w", stdout)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<int, int> pii;
#define mp make_pair
#define fi first
#define se second
#define eps 1e-10

const int mod = 998244353;
template <typename A>
inline int M(A x) {return x;}
template <typename A, typename ... B>
inline int M(A x, B ... args) {return 1ll * x * M(args ...) % mod;}

inline int Mi(const int &x) {return x >= mod ? x - mod : x;}
inline int Ad(const int &x) {return x < 0 ? x + mod : x;}
inline void mi(int &x, const int &y) {x += y; x >= mod && (x -= mod);}
inline void ad(int &x, const int &y) {x -= y; x < 0 && (x += mod);}

inline vector<int> Alice(int n, int m, vector<int> u, vector<int> v, vector<int> c) {
	vector<int> re, du(n); for (int i = 0; i < m; ++i) ++du[u[i]], ++du[v[i]];
	for (int i = 0; i < n; ++i) if (du[i] >= 8) re.push_back(c[i] >> 2), re.push_back(c[i] >> 1 & 1);
	return re;
}

Bob

#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;

#define File(a) freopen(a".in", "r", stdin), freopen(a".out", "w", stdout)
#define Check(a) freopen(a".in", "r", stdin), freopen(a".ans", "w", stdout)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<int, int> pii;
#define mp make_pair
#define fi first
#define se second
#define eps 1e-10

const int mod = 998244353;
template <typename A>
inline int M(A x) {return x;}
template <typename A, typename ... B>
inline int M(A x, B ... args) {return 1ll * x * M(args ...) % mod;}

inline int Mi(const int &x) {return x >= mod ? x - mod : x;}
inline int Ad(const int &x) {return x < 0 ? x + mod : x;}
inline void mi(int &x, const int &y) {x += y; x >= mod && (x -= mod);}
inline void ad(int &x, const int &y) {x -= y; x < 0 && (x += mod);}

inline vector<int> Bob(int n, int m, vector<int> u, vector<int> v, vector<int> c) {
	vector<vector<int> > g(n); vector<int> du(n), col(n), vis(n);
	for (int i = 0; i < m; ++i) g[u[i]].push_back(v[i]), ++du[u[i]], g[v[i]].push_back(u[i]), ++du[v[i]];
	for (int i = 0, j = 0; i < n; ++i) if (du[i] >= 8) col[i] = c[j] << 2 | c[j | 1] << 1, j += 2;
	for (int i = 0; i < n; ++i) if (du[i] >= 8 && !vis[i]) {
		queue<int> q; q.push(i), vis[i] = 1;
		while (!q.empty()) {
			int x = q.front(); q.pop();
			for (int y : g[x]) if (du[y] >= 8 && !vis[y] && col[x] / 2 == col[y] / 2) 
				col[y] = col[x] ^ 1, q.push(y), vis[y] = 1;
		}
	}
	vector<int> cnt(8, 0);
	for (int x = 0; x < n; ++x) if (du[x] < 8) {
		for (int y : g[x]) if (du[y] >= 8 || y < x) ++cnt[col[y]];
		for (int k = 0; k < 8; ++k) !cnt[k] && (col[x] = k), cnt[k] = 0;
	}
	return col;
}

Details

/usr/bin/ld: /tmp/cciYTL27.o: in function `main':
grader_Alice.cpp:(.text.startup+0x143): undefined reference to `Alice(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status