QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#563973 | #9293. Fine Trip | zjy0001 | WA | 0ms | 3888kb | C++14 | 853b | 2024-09-14 18:14:50 | 2024-09-14 18:14:51 |
Judging History
answer
#include<bits/stdc++.h>
#define LL long long
#define LLL __int128
#define uint unsigned
#define ldb long double
#define uLL unsigned long long
using namespace std;
const int N=2e3+5;
const ldb INF=1e50;
int n,m;LL T;ldb d[N];
vector<pair<int,LL>>G[N];
priority_queue<pair<ldb,int>>Q;
inline ldb calc(ldb a,ldb b){
return a+b+sqrtl(a*b);
}
signed main(){
cin.tie(0)->sync_with_stdio(0);
cin>>n>>m>>T;
for(int i=1;i<=m;++i){
int u,v,l,c;cin>>u>>v>>l>>c;
G[u].emplace_back(v,1ll*l*c);
G[v].emplace_back(u,1ll*l*c);
}
fill(d+1,d+n+1,INF);
d[1]=0,Q.emplace(0,1);
while(!Q.empty()){
auto [_,u]=Q.top();Q.pop();
if(-_!=d[u])continue;
for(auto [v,w]:G[u]){
const ldb dv=calc(d[u],w);
if(dv<d[v])d[v]=dv,Q.emplace(-d[v],v);
}
}
cout<<fixed<<setprecision(10)<<1.L*d[n]/T<<'\n';
return 0;
}
/*
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3888kb
input:
3 3 100 1 3 100 100 1 2 100 24 2 3 100 24
output:
72.0000000000
result:
wrong answer 1st numbers differ - expected: '96.0000000', found: '72.0000000', error = '0.2500000'