QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#647004#1212. NavigationGrand_ElfCompile Error//C++17783b2024-10-17 10:53:522024-10-17 10:53:55

Judging History

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

  • [2024-10-17 10:53:55]
  • 评测
  • [2024-10-17 10:53:52]
  • 提交

Anna

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

namespace A {
	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 + 1);
		}
	}
}

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);
}

Details

Anna.code: In function ‘void Anna(int, int, int, int*, int*)’:
Anna.code:23:25: error: ‘Anna’ is not a namespace-name
   23 |         using namespace Anna;
      |                         ^~~~
Anna.code:25:9: error: ‘n’ was not declared in this scope; did you mean ‘A::n’?
   25 |         n = n_;
      |         ^
      |         A::n
Anna.code:8:13: note: ‘A::n’ declared here
    8 |         int n, t;
      |             ^
Anna.code:26:9: error: ‘t’ was not declared in this scope; did you mean ‘A::t’?
   26 |         t = t_;
      |         ^
      |         A::t
Anna.code:8:16: note: ‘A::t’ declared here
    8 |         int n, t;
      |                ^
Anna.code:29:17: error: ‘e’ was not declared in this scope; did you mean ‘A::e’?
   29 |                 e[u].emplace_back(v);
      |                 ^
      |                 A::e
Anna.code:9:21: note: ‘A::e’ declared here
    9 |         vector<int> e[N];
      |                     ^
Anna.code:32:9: error: ‘dfs’ was not declared in this scope; did you mean ‘A::dfs’?
   32 |         dfs(t, 0, 0);
      |         ^~~
      |         A::dfs
Anna.code:11:14: note: ‘A::dfs’ declared here
   11 |         void dfs(int u, int fa, int dis) {
      |              ^~~
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]);
      |                 ~~~~~^~~~~~~~~~~~~~