这道题第2和第7个测试点我错了,90分
查看原帖
这道题第2和第7个测试点我错了,90分
1228547
Jasper111楼主2024/10/24 16:51

代码

#include<bits/stdc++.h>
using namespace std;
int s,v;
int h,m;
int main()
{
	cin>>s>>v;
	int ti_me=ceil(s*1.0/v);
	h=7,m=50;
	if(ti_me<=50)
	{
		printf("%02d:%02d",h,m-ti_me);
		return 0;
	}
	if(ti_me<=470)
	{
		int x=ti_me/60;
		ti_me-=x*60;
		printf("%02d:%02d",h-x,m-ti_me);
		return 0;
	}
	ti_me%=1910;
	h=23,m=60;
	ti_me-=470;
	int x=ti_me/60;
	ti_me-=x*60;
	printf("%02d:%02d",h-x,m-ti_me);
	return 0;
}

2024/10/24 16:51
加载中...