QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#236554 | #2810. Speedrun | Ahmed57# | 0 | 0ms | 0kb | C++23 | 839b | 2023-11-04 05:47:54 | 2023-11-04 05:47:55 |
Judging History
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 = 0;j<adj[i].size();j++){
setHint(i,adj[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);
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Interactor1 Dangerous Syscalls
Test #1:
score: 0
Interactor1 Dangerous Syscalls
input:
output:
input:
output:
result:
Subtask #2:
score: 0
Interactor1 Dangerous Syscalls
Test #5:
score: 0
Interactor1 Dangerous Syscalls
input:
output:
input:
output:
result:
Subtask #3:
score: 0
Interactor1 Dangerous Syscalls
Test #7:
score: 0
Interactor1 Dangerous Syscalls
input:
output:
input:
output:
result:
Subtask #4:
score: 0
Interactor1 Dangerous Syscalls
Test #10:
score: 0
Interactor1 Dangerous Syscalls
input:
output:
input:
output:
result:
Subtask #5:
score: 0
Interactor1 Dangerous Syscalls
Test #16:
score: 0
Interactor1 Dangerous Syscalls