QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#629590#8022. Walkerucup-team3161#WA 0ms3952kbC++14370b2024-10-11 13:34:072024-10-11 13:34:08

Judging History

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

  • [2024-10-11 13:34:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3952kb
  • [2024-10-11 13:34:07]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef double db;
int main()
{
	int T;cin>>T;
	while(T--){
		db n; 
		db p1,p2,v1,v2;
		cin>>n>>p1>>v1>>p2>>v2;
		if(p1>p2) swap(p1,p2),swap(v1,v2);
		db res=(p1+n-p2+n)/(v1+v2);
		res=min(res,max(p1/v1,(n-p2+n-p1)/v2));
		res=min(res,max((n-p2)/v2,(p1+p2)/v1));
		printf("%.12lf\n",res);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3836kb

input:

2
10000.0 1.0 0.001 9999.0 0.001
4306.063 4079.874 0.607 1033.423 0.847

output:

5001000.000000000000
3827.837001375516

result:

ok 2 numbers

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3952kb

input:

1
10.0 1.0 10.0 9.0 0.1

output:

1.188118811881

result:

wrong answer 1st numbers differ - expected: '1.1000000', found: '1.1881188', error = '0.0801080'