結果
| 問題 | No.652 E869120 and TimeZone | 
| コンテスト | |
| ユーザー |  ngtkana | 
| 提出日時 | 2020-03-15 15:55:48 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 4 ms / 1,000 ms | 
| コード長 | 629 bytes | 
| コンパイル時間 | 2,025 ms | 
| コンパイル使用メモリ | 193,368 KB | 
| 最終ジャッジ日時 | 2025-01-09 06:59:26 | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 30 | 
ソースコード
#include<bits/stdc++.h>
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint a,b;std::cin>>a>>b;
    a-=9;
    if(a<0)a+=24;
    char c;
    for(lint i=0;i<4;i++)std::cin>>c;
    lint x;std::cin>>x;
    a+=c=='+'?x:-x;
    char d;std::cin>>d;
    if(d=='.'){
        std::cin>>x;
        x*=6;
        b+=c=='+'?x:-x;
    }
    if(b<0)b+=60,a--;
    if(60<=b)b-=60,a++;
    if(a<0)a+=24;
    if(24<=a)a-=24;
    std::cout<<std::setw(2)<<std::setfill('0')<<a<<':'<<std::setw(2)<<std::setfill('0')<<b<<'\n';
}
            
            
            
        