제출 #772610

#제출 시각아이디문제언어결과실행 시간메모리
772610khshg기지국 (IOI20_stations)C++14
8 / 100
845 ms508 KiB
#include"stations.h" #include<bits/stdc++.h> using namespace std; vector<vector<int>> adj; vector<int> label(int N, int K, vector<int> u, vector<int> v) { vector<int> labels(N); iota(begin(labels), end(labels), 0); return labels; } int find_next_station(int s, int t, vector<int> c) { vector<int> S, T; int start = s, target = t; while(s > 0) { S.push_back(s); s = (s - 1) / 2; } while(t > 0) { T.push_back(t); t = (t - 1) / 2; } int LCA = 0; while((int)S.size() && (int)T.size() && S.back() == T.back()) { LCA = S.back(); S.pop_back(); T.pop_back(); } if(LCA == start) { return T.back(); } return (start - 1) / 2; }

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

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:14:17: warning: unused variable 'target' [-Wunused-variable]
   14 |  int start = s, target = t;
      |                 ^~~~~~
#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...