2050 Programming Competition B 时间间隔

Problem Description

2019年1月1日,在云栖出现了可能是全世界最长的以秒为单位的倒计时装置:九亿多秒倒计时,直到2050年。

给出一个时间S,我们想知道S距离2050年1月1日0点0时0分多少秒。

因为答案可能很大,请输出答案模100的值。

Input 

第一行一个正整数 T (1≤T≤100000) 表示数据组数。

对于每组数据,一行一个字符串表示时间。
时间格式为:YYYY-MM-DD HH:MM:SS,分别表示年、月、日、时,分、秒。

输入的时间保证都在2019年1月1日以后(包含当天)。

 Output

对于每组数据输出一行一个整数表示答案。

Sample Input 

1

2019-01-01 00:00:00

Sample Output 

0

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int maxn=2e5+5;

signed main(){

    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout.tie(0);
    int t;cin>>t;
    while(t--){
        string s;cin>>s;
        cin>>s;
        int a=(s[0]-'0')*10+(s[1]-'0');
        int b=(s[3]-'0')*10+(s[4]-'0');
        int c=(s[6]-'0')*10+(s[7]-'0');
        int ans=(b*60+c)%100;

        if(ans==0)cout<<ans<<endl;
        else cout<<100-ans<<endl;
    }

    return 0;
}

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值