提示: 暴力遍历会超时

Yumi0606 发表于 1年前 · 关联问题 清扫房间

hours,start,cd=map(int,input().split()) rooms=list(range(hours)) time=start for i in range(100000): if time in rooms: rooms.remove(time)

time+=cd if time>= hours: time-=hours if len(rooms)==0: print("Yes") else: print("No",len(rooms),rooms) 本地测试都会超时