B3768 求救!(玄关)
  • 板块灌水区
  • 楼主CDW20110412
  • 当前回复1
  • 已保存回复1
  • 发布时间2024/3/5 17:02
  • 上次更新2024/3/5 19:31:42
查看原帖
B3768 求救!(玄关)
1131450
CDW20110412楼主2024/3/5 17:02
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int s, v0, v1, t1, v2, t2;
	cin >> s >> v0 >> v1 >> t1 >> v2 >> t2;
	int n;
	cin >> n;
	long long npos = 0;
	int ntime = 0;
	for(int i=0;i<n;i++)
	{
		int t;
		int time;
		cin >> t;
		t = t-ntime;
		time = ceil(1.0*(s-npos) / v0);
		if(1ll*(npos + v0*t)>= 1ll*s)
		{
			npos = s;
			ntime+=time;
			break;
		}
		else
		{
			npos = npos+v0*t;
			ntime+=t;
		}
		long long temp;
		temp = (v1+v2*i)*(t1+t2*i);
		npos = npos - temp;
		if(npos<0)
		{
			npos = 0;
		}
		ntime+=t1+t2*i;
	}
	
	if (npos < s)
    {
        ntime = ceil(ntime + 1.0*(s-npos)/v0);
    }
	
	int nday, nhour, nminute, nsecond;
	if(ntime>=3600*24*30)
	{
		nday  = 30;
		nhour = 23;
		nminute = 59;
		nsecond = 59;
		
	}
	else
	{
		nsecond = ntime%60;
		nminute = (ntime%3600)/60;
		nhour   = (ntime%86400)/3600;
		nday    = ntime/86400+1;
	}
	printf("202304%02dat%02d:%02d:%02d\n", nday, nhour, nminute, nsecond);
	return 0;
}
2024/3/5 17:02
加载中...