求助#18 wa
查看原帖
求助#18 wa
672044
Graph_Theory楼主2023/11/22 16:32
/*
18
Time: 0 ms, memory: 140 KB
Verdict: WRONG_ANSWER
Input
1 1000000 1000000 1000000 500000
Participant's output
1e+006 999998
Jury's answer
1000000 999998
Checker comment
wrong output format Expected integer, but "1e+006" found

*/
#include <bits/stdc++.h>
using namespace std;
 
#define coldtem t1
#define hottem t2
#define coldv x1
#define hotv x2
#define anstem t0
#define anshot ans1 
#define anscold ans2
#define nowcold y1
#define nowhot y2
 
double t1,t2,x1,x2,t0,ans1=0,ans2=0,nowtemp;
double tot0min=0x3f3f3f3f;
 
double tem(double y1,double y2)
{return (((t1*y1)+(t2*y2))/(y1+y2));}
int main()
{
	cin>>t1>>t2>>x1>>x2>>t0;
	double y1=x1,y2=x2;
	while(y1>=0&&y2>=0)
	{
		nowtemp=tem(nowcold,nowhot);
		if(nowtemp<anstem)
		{
			nowcold-=1.0;
			continue;
		}
		if(nowtemp-anstem<tot0min)
		{
			tot0min=nowtemp-anstem;
			anshot=nowhot;
			anscold=nowcold;
		}
		nowhot-=1.0; 
	}
	cout<<anscold<<" "<<anshot;
	return 0;
}
2023/11/22 16:32
加载中...