제출 #592457

#제출 시각아이디문제언어결과실행 시간메모리
592457PiejanVDC기지국 (IOI20_stations)C++17
8 / 100
896 ms1188 KiB
#include <bits/stdc++.h> #include "stations.h" using namespace std; vector<int>label(int n, int k, vector<int>u, vector<int>v) { vector<int>l(n); for(int i = 0 ; i < n ; i++) l[i] = i; return l; } vector<set<int>>sub(1005); void dfs(int u) { if(2*u+1 < 1000) { dfs(2*u+1); for(auto it = sub[2*u+1].begin() ; it != sub[2*u+1].end() ; it++) sub[u].insert(*it); } if(2*u+2 < 1000) { dfs(2*u+2); for(auto it = sub[2*u+2].begin() ; it != sub[2*u+2].end() ; it++) sub[u].insert(*it); } sub[u].insert(u); } void gen() { const int n = 1000; dfs(0); } bool f; int find_next_station(int s, int t, vector<int>c) { if(!f) gen(); f = 1; for(int i = 1 ; i < (int)c.size() ; i++) if(sub[c[i]].find(t) != sub[c[i]].end()) return c[i]; return c[0]; }

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

stations.cpp: In function 'void gen()':
stations.cpp:29:15: warning: unused variable 'n' [-Wunused-variable]
   29 |     const int n = 1000;
      |               ^
#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...