QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#563973#9293. Fine Tripzjy0001WA 0ms3888kbC++14853b2024-09-14 18:14:502024-09-14 18:14:51

Judging History

你现在查看的是最新测评结果

  • [2024-09-14 18:14:51]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3888kb
  • [2024-09-14 18:14:50]
  • 提交

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'