제출 #917581

#제출 시각아이디문제언어결과실행 시간메모리
917581shenfe1사이버랜드 (APIO23_cyberland)C++17
15 / 100
876 ms7864 KiB
#include <bits/stdc++.h> #include "cyberland.h" #pragma GCC optimize("Ofast") #pragma GCC optimize("03") #pragma GCC tartget("avx2") using namespace std; #define F first #define S second #define pb push_back #define pii pair<int,int> const int MAX=1e5+15; const double inf=1e18; double dp[MAX]; double solve(int n,int m,int k,int h,vector<int> x,vector<int> y,vector<int> c,vector<int> arr){ vector<pii> g[n+1]; for(int i=0;i<m;i++){ x[i]++; y[i]++; g[x[i]].pb({y[i],c[i]}); g[y[i]].pb({x[i],c[i]}); // cout<<x[i]<<" "<<y[i]<<" "<<c[i]<<"\n"; } k=min(k,30); h++; for(int i=1;i<=n;i++){ dp[i]=inf; } dp[1]=0; double ans=inf; for(int i=0;i<=k;i++){ priority_queue<pair<double,int>> q; for(int i=1;i<=n;i++){ if(dp[i]<inf)q.push({dp[i],i}); } while(!q.empty()){ int v=q.top().S; q.pop(); for(auto to:g[v]){ if(arr[to.F-1]==0&&dp[to.F]>0){ dp[to.F]=0; q.push({dp[to.F],to.F}); } if(dp[v]+to.S<dp[to.F]){ dp[to.F]=dp[v]+to.S; q.push({dp[to.F],to.F}); } } } for(int i=1;i<=n;i++){ if(arr[i-1]==2)dp[i]/=2; } ans=min(ans,dp[h]); } if(ans==inf)return -1.0; return ans; }

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

cyberland.cpp:6: warning: ignoring '#pragma GCC tartget' [-Wunknown-pragmas]
    6 | #pragma GCC tartget("avx2")
      |
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...