제출 #641441

#제출 시각아이디문제언어결과실행 시간메모리
641441SummersSpeedrun (RMI21_speedrun)C++14
0 / 100
2 ms1036 KiB
#include "speedrun.h" #include<bits/stdc++.h> #include<vector> using namespace std; vector<long long>v[10000], 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<s.size();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++)
      |                 ~^~~~~~~~~~~~~
speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:35:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |     for(i=0;i<s.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...