QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#647005 | #1212. Navigation | fast_photon | Compile Error | / | / | C++14 | 862b | 2024-10-17 10:54:05 | 2024-10-17 10:54:06 |
Judging History
Anna
#include "Annalib.h"
#include<vector>
#include<queue>
using namespace std;
int dis[100005], h[100005], en;
queue<int> q;
struct edge {
int v, next;
} e[200005];
void add(int u, int v) {
e[en] = (edge){v, h[u]}; h[u] = en++;
}
void Anna(int K, int N, int T, int A[], int B[]) {
memset(dis, 0x3f, sizeof(dis));
memset(h, 0xff, sizeof(h));
en = 0;
for(int i = 0; i < N - 1; i++) add(A[i], B[i]), add(B[i], A[i]);
q.push(T);
dis[T] = 1;
while(!q.empty()) {
int r = q.front(); q.pop();
Flag(r, dis[r]);
for(int j = h[r]; ~j; j = e[j].next) {
int v = e[j].v;
if(dis[v] > dis[r] + 1) {
dis[v] = dis[r] + 1;
q.push(v);
}
}
}
}
Bruno
#include "Brunolib.h"
void Bruno(int K, int S, int F, int L, int P[], int Q[]) {
for(int i = 0; i < L; i++) {
if(Q[i] < F) F = Q[i], S = P[i];
}
Answer(S);
}
详细
Anna.code: In function ‘void Anna(int, int, int, int*, int*)’: Anna.code:17:9: error: ‘memset’ was not declared in this scope 17 | memset(dis, 0x3f, sizeof(dis)); | ^~~~~~ Anna.code:4:1: note: ‘memset’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? 3 | #include<queue> +++ |+#include <cstring> 4 | 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]); | ~~~~~^~~~~~~~~~~~~~