QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#629601#8022. Walkerucup-team3161#WA 0ms3952kbC++14444b2024-10-11 13:37:392024-10-11 13:37:39

Judging History

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

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

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));
		res=min(res,(min(p1,n-p1)+n)/v1);
		res=min(res,(min(p2,n-p2)+n)/v2);
		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: 3752kb

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: 0
Accepted
time: 0ms
memory: 3952kb

input:

1
10.0 1.0 10.0 9.0 0.1

output:

1.100000000000

result:

ok found '1.1000000', expected '1.1000000', error '0.0000000'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3952kb

input:

1
10.0 8.0 10.0 9.0 0.1

output:

1.200000000000

result:

ok found '1.2000000', expected '1.2000000', error '0.0000000'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3936kb

input:

1
10.0 8.0 0.1 9.0 10

output:

1.100000000000

result:

ok found '1.1000000', expected '1.1000000', error '0.0000000'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3952kb

input:

1
10.0 2.0 0.1 3.0 10

output:

1.300000000000

result:

ok found '1.3000000', expected '1.3000000', error '0.0000000'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

1
10.0 9.0 0.1 8.0 10.0

output:

1.200000000000

result:

ok found '1.2000000', expected '1.2000000', error '0.0000000'

Test #7:

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

input:

1
10.0 4.0 0.1 6.0 0.1

output:

90.000000000000

result:

wrong answer 1st numbers differ - expected: '60.0000000', found: '90.0000000', error = '0.5000000'