求助(91分;第10个测试点未通过)
查看原帖
求助(91分;第10个测试点未通过)
1779503
JcJia楼主2025/6/16 22:05

代码如下:

#include<bits/stdc++.h>
using namespace std;

int main() {
	int s, v, c, d, e, f;
	cin >> s >> v;
	c = s / v;
	if (s % v != 0)
		c++;
	c += 10;
	if (c / 60 <= 7 or c/60==8 and c%60==0)
	{
		d = c / 60 +1;
		if(c%60==0) d--;
	}
	else{
		d = c / 60 + 1 - 24;
		if(c%60==0 ) d--;
	}
		
	d = 8 - d;
	c %= 60;
	if (d <= 10) cout << "0";
	if(c!=0)
	{
		if (60 - c >= 10 )
			cout << d << ":" << 60 - c << endl;
		else
			cout << d << ":0" << 60 - c << endl;
	}
	else
		cout << d << ":00" << endl;	
	return 0;
}
2025/6/16 22:05
加载中...