제출 #641442

#제출 시각아이디문제언어결과실행 시간메모리
641442SummersSpeedrun (RMI21_speedrun)C++14
0 / 100
183 ms804 KiB
#include "speedrun.h" #include<bits/stdc++.h> #include<vector> using namespace std; vector<long long>v[2000], s; long long n, fath[1005]; void dfs(long long vr,long long f) { s.push_back(vr); fath[vr]=f; for(int i=0;i<v[vr].size();i++) { if(v[vr][i]!=f)dfs(v[vr][i],vr); } } void assignHints(int subtask, int N, int A[], int B[]) { long long i,j; setHintLen(20); n=N; for(i=1;i<N;i++) { v[A[i]].push_back(B[i]); v[B[i]].push_back(A[i]); } dfs(1,-1); for(i=0;i<n;i++) { long long f = fath[s[i]]; long long node = s[(i+1)%n]; for(j=1;j<=10;j++) { setHint(s[i],j,((1<<(j-1))&f)); setHint(s[i],j+10,((1<<(j-1))&node)); } } } void speedrun(int subtask, int N, int start) { int i,j; for(i=1;i<=n;i++) { long long node=0; for(j=11;j<=20;j++) { node=node|((getHint(j))<<(j-11)); } while(!goTo(node)) { long long f=0; for(j=1;j<=10;j++) { f=f|((getHint(j))<<(j-1)); } goTo(f); } } }

컴파일 시 표준 에러 (stderr) 메시지

speedrun.cpp: In function 'void dfs(long long int, long long int)':
speedrun.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i=0;i<v[vr].size();i++)
      |                 ~^~~~~~~~~~~~~
#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...