后3个测试点WA , 求救!

P5707 【深基2.例12】上学迟到

没有考虑到凌晨0点以前出发的情况(即用时大于480min). 例如当输入10000 5时,代码输出为-1:-30. 为了解决这个问题,需要进行特判 [AC代码](https://www.luogu.com.cn/record/157611291): ```c # include <cstdio> using namespace std; int main() { int s, v, t; scanf("%d %d", &s, &v); if(s % v == 0) t = (s / v); else t = (s / v) + 1; if(t >= 24 * 60) t -= 24 * 60; int t2 = 480; //t = t2 - 10 - t;负数. if(t+10>t2) t=24*60-t-10+480; else t=t2-10-t; int x, f; x = t / 60; f = t % 60; printf("%02d%c%02d", x, ':', f); return 0; } ```
by RH233 @ 2024-05-01 20:08:32


@[RH233](https://www.luogu.com.cn/user/801159#following) 谢谢,已AC,此贴完。
by HZT1121 @ 2024-05-02 12:51:13


|