QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#236553#2810. SpeedrunAhmed57#Compile Error//C++23814b2023-11-04 05:46:522024-05-20 18:53:02

Judging History

你现在查看的是测评时间为 2024-05-20 18:53:02 的历史记录

  • [2024-06-05 09:14:28]
  • 管理员手动重测本题所有提交记录
  • [2024-05-20 18:53:02]
  • 管理员手动重测本题所有提交记录
  • [2023-11-04 05:46:52]
  • 评测
  • [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);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~