[悬关]求助
  • 板块灌水区
  • 楼主GzkThunder
  • 当前回复9
  • 已保存回复9
  • 发布时间2024/7/24 23:27
  • 上次更新2024/7/25 09:15:25
查看原帖
[悬关]求助
1017771
GzkThunder楼主2024/7/24 23:27

T105951


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll h,m,x,cnt,old;

main()
{
    scanf("%lld:%lld",&h,&m);
    cin>>x;
    //cout<<x<<endl;
    x=x%60*24;
    ll t=h*60+m;
    old=t;
    while(true)
    {
        if(h%10==m/10&&h/10==m%10)
        {
            cout<<h<<':'<<m<<endl<<cnt;
            break;
        }
        t-=x;
        if(t==old)
        {
            cout<<"No Solution";
            break;
        }
        if(t<24*60)
        {
            t+=24*60;
        }
        cnt++;
    }
}
2024/7/24 23:27
加载中...