제출 #1368110

#제출 시각아이디문제언어결과실행 시간메모리
1368110cansu_mutlu기지국 (IOI20_stations)C++20
0 / 100
1 ms488 KiB
#include "stations.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
const int mxn = 1e3+3;
vector<int> a[mxn];
int cur = 0;
int l[mxn];
void dfs(int s,int anne,int c)
{
  if(c==0)
  {
    l[s] = cur;
  }
  cur++;
  for(int x:a[s])
  {
    if(x!=anne)
    {
      dfs(x,s,1-c);
    }
  }
  if(c==1)
  {
    l[s]=cur;
  }
  cur++;
}
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
	cur = 0;
  for(int i=0;i<n;i++)
  {
    a[i].clear();
  }
  for(int i=0;i<n-1;i++)
  {
    a[u[i]].push_back(v[i]);
    a[v[i]].push_back(u[i]);
  }
  dfs(0,-1,0);
}

int find_next_station(int s, int t, std::vector<int> c)
{
  int n = c.size();
	
    vector<int> in(n+1);
    if(t<s || t>c.back()) return c[0];
    c[0] = s;
    for(int i=1;i<n;i++)
    {
      if(t>c[i-1] && t<=c[i]) return c[i];
    }
 
}

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

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
   41 | }
      | ^
stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…