제출 #657879

#제출 시각아이디문제언어결과실행 시간메모리
657879activedeltorre즐거운 행로 (APIO20_fun)C++14
0 / 100
2 ms2644 KiB
#include "fun.h" #include <vector> using namespace std; int cnt=0; int poz[100005]; vector<int>adj[100005]; void dfs(int curr) { int i,k; for(i=0;i<adj[curr].size();i++) { k=adj[curr][i]; dfs(k); } poz[cnt]=curr; cnt++; } vector<int> createFunTour(int n, int q) { int i,st,dr; vector<int>vec; for(i=1; i<n; i++) { adj[(i-1)/2].push_back(i); } dfs(0); st=0; dr=n-1; while(st<dr) { vec.push_back(poz[st]); vec.push_back(poz[dr]); dr--; st++; } if(st==dr) { vec.push_back(poz[st]); } return vec; }

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

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