結果

問題 No.652 E869120 and TimeZone
ユーザー face4
提出日時 2018-04-29 20:55:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 66,284 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 23:41:06
合計ジャッジ時間 1,483 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 2
other AC * 25 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    double a, b;
    string t;
    cin >> a >> b >> t;
    double utc = (stod(t.substr(3, t.size()))) - 9.0;
    double difmin = (utc*10*6);
    b += difmin;
    if(b >= 60){
        a += b/60;
        b -= b/60 * 60;
    }else if(b < 0){
        while(b < 0){
            a--;
            b += 60.0;
        }
    }

    if(a < 0)   a += 24;
    if(a > 24)  a -= 24;

    cout << (10 > a ? "0" : "") << a << ":" << (10 > b ? "0" : "") << b << endl;
    return 0;
}
0