用的python,60分4567没过,求大佬纠正
查看原帖
用的python,60分4567没过,求大佬纠正
1310541
_yjhhh楼主2024/3/14 22:28
import math
s,v = map(int,input().split())
if s / v == s // v:
    t = s // v + 10
else:
    t = math.ceil(s*1.0 / v) + 10

if t < 60:
    if t <= 50:
        str1 = f"07:{60 - t}"
        print(str1)
    else:
        str1 = f"07:0{10-t%50}"
        print(str1)
elif t >= 60:
    if t <= 480:
        if t % 60 != 0:
            if t % 60 > 50:
                str1 = f"0{8 - t//60}:0{10 - (t-(t//60)*60)%50}"
                print(str1)
            else:
                str1 = f"0{8-t//60}:{60-t%60}"
        else:
            print(f"0{8-t//60}:00")
    elif t <= 1440:
        t -= 480
        if t % 60 != 0:
            if t % 60 <= 50:
                str = f'{23-t//60}:{60-t%60}'
                str.zfill(5)
                print(str)
            else:
                str = f'{23-t//60}:0{10-(t-(t//60)*60)%50}'
                str.zfill(5)
                print(str)
        else:
            str1 = f'{24-t//60}:00'
            str1.zfill(5)
            print(str1)
2024/3/14 22:28
加载中...