QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#451529#8109. Postcards_l_l_Compile Error//C++141.2kb2024-06-23 16:16:162024-06-23 16:16:17

Judging History

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

  • [2024-06-23 16:16:17]
  • 评测
  • [2024-06-23 16:16:16]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3005, MAXM = 500005, MAXR = 105;
int uu[MAXM], vv[MAXM], deg[MAXN][MAXN]; vector<int> G[MAXN];
int fa[MAXN], dfn[MAXN], low[MAXN], times; void dfs(int u, int f) {
	dfn[u] = ++times; fa[u] = f; for (int v : G[u]) if (v != f) dfs(v, u); low[u] = times;
}
int main() {
	int n, m, q; scanf("%d %d %d", &n, &m, &q);
	for (int i = 1; i <= m; i++) {
		int u, v; scanf("%d %d", &u, &v); G[u].push_back(v); G[v].push_back(u); uu[i] = u; vv[i] = v;
	}
	dfs(1, 1);
	for (int u = 1; u <= n; u++) for (int v : G[u]) deg[dfn[u]][dfn[v]]++;
	for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) {
		deg[i][j] += deg[i - 1][j] + deg[i][j - 1] - deg[i - 1][j - 1];
	}
	int lans = 0;
	while (q--) {
		int r; scanf("%d", &r); vector<int> nod{1}; vector<pair<int, int> > del; while (r--) {
			int x, p1, p2; scanf("%d %d %d", &x, &p1, &p2);
			x = (x + lans) % m + 1;
			if (p1) del.push_back({uu[x], vv[x]}); if (p2) del.push_back({vv[x], uu[x]});
			if (fa[uu[x]] == vv[x]) nod.push_back(uu[x]);
			if (fa[vv[x]] == uu[x]) nod.push_back(vv[x]);
		}
		sort(nod.begin(), nod.end(), [&](int x, int y) {return dfn[x] < dfn[y];});
		nod.resize(nod.)
	}
}

详细

answer.code: In function ‘int main()’:
answer.code:28:32: error: expected unqualified-id before ‘)’ token
   28 |                 nod.resize(nod.)
      |                                ^
answer.code:9:27: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         int n, m, q; scanf("%d %d %d", &n, &m, &q);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
answer.code:11:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                 int u, v; scanf("%d %d", &u, &v); G[u].push_back(v); G[v].push_back(u); uu[i] = u; vv[i] = v;
      |                           ~~~~~^~~~~~~~~~~~~~~~~
answer.code:20:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |                 int r; scanf("%d", &r); vector<int> nod{1}; vector<pair<int, int> > del; while (r--) {
      |                        ~~~~~^~~~~~~~~~
answer.code:21:45: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |                         int x, p1, p2; scanf("%d %d %d", &x, &p1, &p2);
      |                                        ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~