QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#236552#2810. SpeedrunAhmed57#Compile Error//C++23792b2023-11-04 05:44:272024-06-05 09:14:25

Judging History

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

  • [2024-06-05 09:14:25]
  • 管理员手动重测本题所有提交记录
  • [2024-05-20 18:53:01]
  • 管理员手动重测本题所有提交记录
  • [2023-11-04 05:44:27]
  • 评测
  • [2023-11-04 05:44:27]
  • 提交

speedrun

#include <bits/stdc++.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(auto 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:16:18: error: ‘j’ does not name a type
   16 |         for(auto j:adj[i]){
      |                  ^
speedrun.code:18:10: error: expected ‘;’ before ‘}’ token
   18 |         }
      |          ^
      |          ;
   19 |     }
      |     ~     
speedrun.code:19:5: error: expected primary-expression before ‘}’ token
   19 |     }
      |     ^
speedrun.code:18:10: error: expected ‘;’ before ‘}’ token
   18 |         }
      |          ^
      |          ;
   19 |     }
      |     ~     
speedrun.code:19:5: error: expected primary-expression before ‘}’ token
   19 |     }
      |     ^
speedrun.code:18:10: error: expected ‘)’ before ‘}’ token
   18 |         }
      |          ^
      |          )
   19 |     }
      |     ~     
speedrun.code:16:12: note: to match this ‘(’
   16 |         for(auto j:adj[i]){
      |            ^
speedrun.code:19:5: error: expected primary-expression before ‘}’ token
   19 |     }
      |     ^
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);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~