五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 1714A - Everyone Loves to Sleep

2023-06-27 15:54 作者:您是打尖兒還是住店呢  | 我要投稿

Vlad, like everyone else, loves to sleep very much.


Every day Vlad has to do n things, each at a certain time. For each of these things, he has an alarm clock set, the i-th of them is triggered on hi hours mi minutes every day (0≤hi<24,0≤mi<60). Vlad uses the 24-hour time format, so after h=12,m=59 comes h=13,m=0 and after h=23,m=59 comes h=0,m=0.

This time Vlad went to bed at H hours M minutes (0≤H<24,0≤M<60) and asks you to answer: how much he will be able to sleep until the next alarm clock.

If any alarm clock rings at the time when he went to bed, then he will sleep for a period of time of length 0.

-------------------------

弗拉德和其他人一樣,非常喜歡睡覺。


弗拉德每天必須在特定的時間做 n 件事。 對于每件事,他都設(shè)置了一個鬧鐘,其中第 i 個鬧鐘在每天 hi 小時 mi 分鐘觸發(fā)(0≤hi<24,0≤mi<60)。 Vlad 使用 24 小時時間格式,因此在 h=12,m=59 之后為 h=13,m=0,在 h=23,m=59 之后為 h=0,m=0。

這次Vlad在H小時M分鐘(0≤H<24,0≤M<60)上床睡覺,并要求你回答:直到下一個鬧鐘他還能睡多久。

如果他上床睡覺的時候有鬧鐘響了,那么他會睡一段長度為0的時間。

-----------------------------------------

把小時分鐘換算成分鐘數(shù),如果鬧鐘的分鐘數(shù)大于睡覺對應(yīng)的分鐘數(shù),那么睡覺的時間就是鬧鐘的分鐘數(shù)-睡覺對應(yīng)的分鐘數(shù),如果小于,那么就是鬧鐘的分鐘數(shù)+24*60-睡覺對應(yīng)的分鐘數(shù)即可,依次求最小值,然后將最小值換成成小時分鐘即可;

下面是代碼:


CF 1714A - Everyone Loves to Sleep的評論 (共 條)

分享到微博請遵守國家法律
宁明县| 阳山县| 闽侯县| 铜鼓县| 南雄市| 明溪县| 福清市| 建德市| 呼和浩特市| 浦江县| 铜山县| 邳州市| 盐津县| 泽普县| 荆州市| 祁连县| 贵溪市| 汽车| 南江县| 西宁市| 建德市| 凌源市| 石阡县| 那曲县| 饶平县| 儋州市| 虎林市| 汕头市| 葫芦岛市| 温泉县| 八宿县| 肇州县| 长兴县| 喀喇沁旗| 桂平市| 剑川县| 黑山县| 潞西市| 延津县| 茶陵县| 申扎县|