제출 #1080160

#제출 시각아이디문제언어결과실행 시간메모리
1080160Sir_Ahmed_ImranStations (IOI20_stations)C++17
0 / 100
2063 ms2097152 KiB
///~~~LOTA~~~/// //#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define append push_back #define add insert #define nl '\n' #define ff first #define ss second #define pii pair<int,int> #define pll pair<ll,ll> #define all(x) (x).begin(),(x).end() #define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define terminator main #define N 1501 int m; vector<int> l; vector<int> a[N]; void dfs(int v,int u){ int r=1e9; for(auto& i:a[v]){ if(i==u) continue; dfs(i,v); r=min(r,l[i]/1000); } l[v]=min(r,m)*1000+m; m++; } vector<int> label(int n,int k,vector<int> u,vector<int> v){ for(int i=m=0;i<n-1;i++){ a[u[i]].append(v[i]); a[v[i]].append(u[i]); } for(int i=0;i<n;i++) l.append(0); dfs(0,-1); return l; } int find_next_station(int s,int t,vector<int> c){ int l,r,p,q,x,y,z; l=s/1000;r=s%1000; p=t/1000;q=t%1000; for(auto& i:c){ x=i/1000; y=i%1000; if(x<=l && r<=y) z=i; if(l<=x && y<=r && x<=p && q<=y) return i; } return z; }

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

stations.cpp: In function 'int find_next_station(int, int, std::vector<int>)':
stations.cpp:42:21: warning: 'z' may be used uninitialized in this function [-Wmaybe-uninitialized]
   42 |     int l,r,p,q,x,y,z;
      |                     ^
#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...