QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#646997#1212. NavigationGrand_ElfCompile Error//C++17782b2024-10-17 10:51:572024-10-17 10:51:57

Judging History

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

  • [2024-10-17 10:51:57]
  • 评测
  • [2024-10-17 10:51:57]
  • 提交

Anna

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

namespace Anna {
	const int N = 1e5 + 5;

	int n, t;
	vector<int> e[N];

	void dfs(int u, int fa, int dis) {
		Flag(u, dis);
		for (int v : e[u]) {
			if (v == fa) {
				continue;
			}
			dfs(v, u, dis);
		}
	}
}

void Anna(int subid, int n_, int t_, int x[], int y[]) {
	using namespace Anna;

	n = n_;
	t = t_;
	for (int i = 0; i < n - 1; i++) {
		int u = x[i], v = y[i];
		e[u].emplace_back(v);
		e[v].emplace_back(u);
	}
	dfs(t, 0, 0);
}

Bruno

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

void Bruno(int subid, int s, int F, int L, int P[], int Q[]) {
	for (int i = 0; i < L; i++) {
		if (F > Q[i]) {
			Answer(P[i]);
			return;
		}
	}
	Answer(s);
}

詳細信息

Anna.code:22:54: error: ‘void Anna(int, int, int, int*, int*)’ redeclared as different kind of entity
   22 | void Anna(int subid, int n_, int t_, int x[], int y[]) {
      |                                                      ^
Anna.code:5:11: note: previous declaration ‘namespace Anna { }’
    5 | namespace Anna {
      |           ^~~~
grader.cpp: In function ‘int main(int, char**)’:
grader.cpp:144:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  144 |         scanf("%d%d%d%d", &K, &S, &F, &L);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
grader.cpp:146:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  146 |                 scanf("%d", &P_[i]);
      |                 ~~~~~^~~~~~~~~~~~~~
grader.cpp:150:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  150 |                 scanf("%d", &Q_[i]);
      |                 ~~~~~^~~~~~~~~~~~~~