제출 #580089

#제출 시각아이디문제언어결과실행 시간메모리
580089FatihSolakSpeedrun (RMI21_speedrun)C++17
0 / 100
263 ms820 KiB
#include <bits/stdc++.h> #include "speedrun.h" #define N 1005 using namespace std; vector<int> adj[N]; bool sub[N]; void init(int v,int num1,int num2){ for(int i = 0;i<10;i++){ setHint(v,i+1,!!(num1 & (1<<(9-i)))); } for(int i = 0;i<10;i++){ setHint(v,i+11,!!(num2 & (1<<(9-i)))); } } void dfs(int v,int par,int num2){ int num1 = 0; for(auto u:adj[v]){ if(u == par)continue; if(num1 == 0)num1 = u; } int c = par; for(int i = adj[v].size()-1;i>=0;i--){ if(adj[v][i] == par)continue; dfs(adj[v][i],v,c); c = adj[v][i]; } if(num1 == 0)num1 = par; init(v,num1,num2); } void assignHints(int subtask, int n, int A[], int B[]) { setHintLen(20); for(int i = 1;i<n;i++){ adj[A[i]].push_back(B[i]); adj[B[i]].push_back(A[i]); } dfs(1,0,0); } int get(int x){ int ret = 0; for(int i = 0;i<10;i++){ ret += getHint(i + 1 + 10 * (x-1)) * (1<<(9-i)); } return ret; } void go(int v){ if(sub[v]){ return; } sub[v] = 1; int now = get(1); while(goTo(now)){ adj[v].push_back(now); now = get(2); goTo(v); } // cout << v << endl; // for(auto u:adj[v]){ // cout << u << " "; // } // cout << endl; for(int i = 0;i<adj[v].size();i++){ if(i)goTo(v); goTo(adj[v][i]); go(adj[v][i]); } } void speedrun(int subtask, int n, int start) { for(int i = 1;i<=n;i++){ adj[i].clear(); } if(n == 1)return; go(start); }

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

speedrun.cpp: In function 'void go(int)':
speedrun.cpp:61:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   61 |     for(int i = 0;i<adj[v].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...