結果

問題 No.652 E869120 and TimeZone
ユーザー face4face4
提出日時 2018-04-29 20:55:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 66,640 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 08:11:33
合計ジャッジ時間 1,869 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,384 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,376 KB
testcase_24 WA -
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 WA -
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 WA -
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

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