Submission #765283

#TimeUsernameProblemLanguageResultExecution timeMemory
765283vjudge1Speedrun (RMI21_speedrun)C++17
21 / 100
64 ms48360 KiB
#include <bits/stdc++.h> #include "speedrun.h" using namespace std; const int MAXN=1e3+5; vector<int> sos[MAXN][MAXN]; int cnt[MAXN]; vector<vector<int> > g(MAXN); void assignHints(int subtask, int N, int A[], int B[]) { if(subtask==1) { setHintLen(N); for(int i=1; i<N; i++) { g[A[i]].push_back(B[i]); g[B[i]].push_back(A[i]); } for(int i=1; i<=N; i++) { for(auto to : g[i])setHint(i, to, 1); } } if(subtask==3) { setHintLen(20); for(int i=1; i<N; i++) { g[A[i]].push_back(B[i]); g[B[i]].push_back(A[i]); } for(int i=1; i<=N; i++) { int cnt=0; for(auto to : g[i]) { if(cnt==0) { for(int j=0; j<=9; j++) { setHint(i, j, (to&(1<<j) ? 1 : 0)); } }else { for(int j=10; j<=19; j++) { setHint(i, j, (to&(1<<(j-10)) ? 1 : 0)); } } } } } return; } int us[MAXN]; void dfs(int v, int p, int N, int subtask) { us[v]=1; if(subtask==1) { vector<int> gg; for(int j=1; j<=N; j++) { if(getHint(j))gg.push_back(j); } for(auto to : gg) { if(!us[to]) { goTo(to); dfs(to, v, N, subtask); } } if(v!=p)goTo(p); else return; } if(subtask==3) { vector<int> gg; int x=0, y=0; for(int j=0; j<=9; j++) { if(getHint(j))x+=(1<<j); } for(int j=10; j<=19; j++) { if(getHint(j))y+=(1<<(j-10)); } gg.push_back(x); gg.push_back(y); for(auto to : gg) { if(!us[to]) { goTo(to); dfs(to, v, N, subtask); } } if(v!=p)goTo(p); else return; } } void speedrun(int subtask, int N, int start) { if(subtask==1) { int len=getLength(); dfs(start, start, N, subtask); } if(subtask==3) { int len=getLength(); dfs(start, start, N, subtask); } return; }

Compilation message (stderr)

speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:82:7: warning: unused variable 'len' [-Wunused-variable]
   82 |   int len=getLength();
      |       ^~~
speedrun.cpp:86:7: warning: unused variable 'len' [-Wunused-variable]
   86 |   int len=getLength();
      |       ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...