CF108A.Palindromic Times

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Tattah is asleep if and only if Tattah is attending a lecture. This is a well-known formula among Tattah's colleagues.

On a Wednesday afternoon, Tattah was attending Professor HH's lecture. At 12:21, right before falling asleep, he was staring at the digital watch around Saher's wrist. He noticed that the digits on the clock were the same when read from both directions i.e. a palindrome.

In his sleep, he started dreaming about such rare moments of the day when the time displayed on a digital clock is a palindrome. As soon as he woke up, he felt destined to write a program that finds the next such moment.

However, he still hasn't mastered the skill of programming while sleeping, so your task is to help him.

塔塔赫只有在听课时才会睡着。这是塔塔赫同事们熟知的一条公式。

某个星期三下午,塔塔赫正在听哈立德教授(Professor HH)的课。在12:21,就在他即将入睡之前,他正盯着萨赫尔(Saher)手腕上的数字手表。他注意到此时钟表上显示的数字从左往右读和从右往左读完全相同,即构成一个回文。

在睡梦中,他开始幻想一天中那些罕见的时刻——数字钟表所显示的时间恰好是一个回文。刚一醒来,他就感到自己命中注定要编写一个程序,用以找出下一个这样的时刻。

然而,他尚未掌握边睡觉边编程这项技能,因此,你的任务就是帮他实现这个程序。

输入格式

The first and only line of the input starts with a string with the format "HH:MM" where "HH" is from "00" to "23" and "MM" is from "00" to "59". Both "HH" and "MM" have exactly two digits.

输入的第一行且唯一一行以格式为 "HH:MM" 的字符串开头,其中 "HH" 的取值范围是 "00" 到 "23","MM" 的取值范围是 "00" 到 "59"。"HH" 和 "MM" 均恰好为两位数字。

输出格式

Print the palindromic time of day that comes soonest after the time given in the input. If the input time is palindromic, output the soonest palindromic time after the input time.

输出输入时间之后最近的回文时刻。如果输入时间本身是回文时刻,则输出该时刻之后最近的回文时刻。

输入输出样例

  • 输入#1

    12:21

    输出#1

    13:31
  • 输入#2

    23:59

    输出#2

    00:00

输入解题思路,AI测评打分。不知道怎么写?

首页