제출 #645506

#제출 시각아이디문제언어결과실행 시간메모리
645506TimDeeSpeedrun (RMI21_speedrun)C++17
29 / 100
123 ms8784 KiB
#include "speedrun.h" #include <bits/stdc++.h> using namespace std; void assignHints(int id,int n, int a[], int b[]) { if (id==1) { setHintLen(n); for(int i=1;i<=n-1;++i) { int u=a[i],v=b[i]; setHint(u,v,1); setHint(v,u,1); } } if (id==2) { setHintLen(20); vector<int>deg(n+1,0); for(int i=0;i<n-1;++i) deg[a[i]]++; for(int i=0;i<n-1;++i) deg[b[i]]++; int mx=0; for(int i=1;i<=n;++i) if (deg[i]>deg[mx]) mx=i; for (int i=1; i<=n; ++i) { if (i==mx) setHint(i,20,1); for (int j=11; j>0; --j) { setHint(i,j,!!(mx&(1<<(j-1)))); } } } if (id==3) { } } int n; vector<vector<int>> adj(1e3+1,vector<int>(1e3+1,0)); void dfs(int u, int p) { for (int j=1; j<=n; ++j) { adj[u][j]=getHint(j); } for (int i=1; i<=n; ++i) { if (i==p) continue; if (adj[u][i]) { goTo(i); dfs(i,u); } } if (p==-1) return; goTo(p); } int center=0; vector<int> vis(1e3+1,0); void speedrun(int id,int N,int start) { n=N; if (id==1) { dfs(start,-1); } if (id==2) { for (int j=11; j>0; --j) { center+=getHint(j)<<(j-1); } bool b=getHint(20); if (!b) { goTo(center); } for (int i=1; i<=n; ++i) { if (i==center) continue; goTo(i); goTo(center); } } }
#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...