제출 #835230

#제출 시각아이디문제언어결과실행 시간메모리
835230DJeniUp기지국 (IOI20_stations)C++17
0 / 100
3045 ms2097152 KiB
#include "stations.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define N 1007 ll n,tin[N],tout[N],h; vector<int>v[N],res; ll S(ll x,ll y){ tin[x]=h; tout[x]=h; h++; for(int i=0;i<v[x].size();i++){ if(v[x][i]!=y){ tout[x]=S(v[x][i],x); } } return tout[x]; } std::vector<int> label(int N1, int k, std::vector<int> u, std::vector<int> w) { n=N1; res.resize(n); for(int i=0;i<u.size();i++){ v[u[i]].pb(w[i]); v[w[i]].pb(u[i]); } S(0,0); for(int i=0;i<n;i++){ res[i]=tin[i]*1000+tout[i]; } return res; } int find_next_station(int s, int t, std::vector<int> c) { exit(0); n=c.size(); ll tin1=s/1000; ll tout1=s%1000; ll tin2=t/1000; ll tout2=t%1000; for(int i=0;i<n;i++){ tin[i]=c[i]/1000; tout[i]=c[i]%1000; } if(tin1<=tin2 && tout2<=tout1){ for(int i=0;i<n;i++){ if(tin[i]<=tin2 && tout2<=tout[i])return c[i]; } }else{ for(int i=0;i<n;i++){ if(tin[i]<tin1)return c[i]; } } return 0; }

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

stations.cpp: In function 'll S(ll, ll)':
stations.cpp:17:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |  for(int i=0;i<v[x].size();i++){
      |              ~^~~~~~~~~~~~
stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:28:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |  for(int i=0;i<u.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...