QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#236553 | #2810. Speedrun | Ahmed57# | Compile Error | / | / | C++23 | 814b | 2023-11-04 05:46:52 | 2023-11-04 05:46:52 |
Judging History
你现在查看的是测评时间为 2023-11-04 05:46:52 的历史记录
- [2024-06-05 09:14:28]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-05-20 18:53:02]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-11-04 05:46:52]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-11-04 05:46:52]
- 提交
speedrun
#include <bits/stdc++.h>
#include "speedrun.h"
using namespace std;
void setHintLen(int l);
void setHint(int i, int j, bool b);
int getLength();
bool getHint(int j);
bool goTo(int x);
vector<int> adj[1001];
void assignHints(int subtask,int N,int A[],int B[]){
setHintLen(N);
for(int i = 1;i<N;i++){
adj[A[i]].push_back(B[i]);
adj[B[i]].push_back(A[i]);
}
for(int i = 1;i<=N;i++){
for(int j:adj[i]){
setHint(i,j,1);
}
}
}
int vis[1001];
int n;
void dfs(int i){
vis[i] = 1;
for(int j = 1;j<=n;j++){
if(vis[j])continue;
if(getHint(j)){
goTo(j);
dfs(j);
goTo(i);
}
}
}
void speedrun(int subtask, int N, int start){
n = N;
dfs(start);
}
详细
speedrun.code: In function ‘void assignHints(int, int, int*, int*)’: speedrun.code:17:19: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’ 17 | for(int j:adj[i]){ | ^~~ speedrun.code:17:24: error: forming reference to reference type ‘std::vector<int>&’ 17 | for(int j:adj[i]){ | ^ grader_speedrun.cpp: In function ‘int readvalue()’: grader_speedrun.cpp:9:9: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | fscanf(input, "%d", &val); | ~~~~~~^~~~~~~~~~~~~~~~~~~