제출 #756223

#제출 시각아이디문제언어결과실행 시간메모리
756223activedeltorre서열 (APIO23_sequence)C++17
컴파일 에러
0 ms0 KiB
#include <vector> #include <iostream> #include <queue> #include <iomanip> #pragma GCC optimize ("O3") #include "cyberland.h" using namespace std; long double inf=1e17; double dp[100005][55]; vector<pair<int,int> >adj[100005]; priority_queue<pair<int,pair<double,int> > >pq; double solve(int n,int m,int k,int fs,vector<int>x,vector<int>y,vector<int>cst,vector<int>arr) { int i,j; k=min(k,40); for(i=0; i<m; i++) { adj[x[i]].push_back({y[i],cst[i]}); adj[y[i]].push_back({x[i],cst[i]}); } for(i=0; i<n; i++) { for(j=0; j<=k; j++) { dp[i][j]=inf; } } dp[0][0]=0; pq.push({0,{0,0}}); int layer,curr,vec; double timp,cost; while(pq.size()) { layer=pq.top().first; timp=pq.top().second.first; curr=pq.top().second.second; pq.pop(); if(dp[curr][layer]==-timp && curr!=fs) { for(i=0; i<adj[curr].size(); i++) { vec=adj[curr][i].first; cost=adj[curr][i].second; if(arr[vec]==0 && dp[vec][layer]!=0) { dp[vec][layer]=0; pq.push({layer,{0,vec}}); } else if(dp[curr][layer]+cost<dp[vec][layer]) { dp[vec][layer]=dp[curr][layer]+cost; pq.push({layer,{-dp[vec][layer],vec}}); } if(arr[vec]==2 && dp[curr][layer]+cost<dp[vec][layer+1]*2) { dp[vec][layer+1]=(dp[curr][layer]+cost)/2; pq.push({layer+1,{-dp[vec][layer+1],vec}}); } } } } double sol=inf; for(i=0; i<=k; i++) { sol=min(sol,dp[fs][i]); } for(i=0;i<=n;i++) { adj[i].clear(); } if(sol==inf) { return -1; } return sol; } /* int main() { int T; cin>>T; while (T--) { int N,M,K,H; cin>>N>>M>>K>>H; std::vector<int> x(M); std::vector<int> y(M); std::vector<int> c(M); std::vector<int> arr(N); for (int i=0; i<N; i++) cin>>arr[i]; for (int i=0; i<M; i++) { cin>>x[i]>>y[i]>>c[i]; } cout<<setprecision(12)<<solve(N, M, K, H, x, y, c, arr)<<'\n'; } } */

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

sequence.cpp:6:10: fatal error: cyberland.h: No such file or directory
    6 | #include "cyberland.h"
      |          ^~~~~~~~~~~~~
compilation terminated.