結果

問題 No.652 E869120 and TimeZone
ユーザー aaaaaaiu
提出日時 2019-08-20 00:25:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 441 bytes
コンパイル時間 1,798 ms
コンパイル使用メモリ 193,616 KB
最終ジャッジ日時 2025-01-07 14:18:44
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int h,m;
    string s;
    cin>>h>>m>>s;
    int t=60*h+m-540;
    int n=0;
    for (int i=4;i<s.size()&&isdigit(s[i]);i++) {
        n*=10;
        n+=s[i]-'0';
    }
    int tt=60*n;
    if (s[s.size()-2]=='.') tt+=6*(s[s.size()-1]-'0');
    if (s[3]=='-') tt=-tt;
    t+=tt;
    t=(t+24*60)%(24*60);
    printf("%02d:%02d\n",t/60,t%60);
    return 0;
}
0