結果

問題 No.652 E869120 and TimeZone
ユーザー tactac
提出日時 2019-07-26 15:41:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,179 bytes
コンパイル時間 2,270 ms
コンパイル使用メモリ 166,624 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-15 00:23:05
合計ジャッジ時間 4,973 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define out(a) cout << a << endl
#define outa(a, n) rep(_, n) cout << a[_] << " "; cout << endl
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)

int main() {
    int a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    double tmp = stod(s.substr(3, SZ(s) - 3));
    char op = (tmp - 9 > 0 ? '+' : '-');
    tmp = abs(9 - tmp);
    int n1 = tmp;
    tmp -= n1;
    tmp *= 10;
    int n2 = tmp;
    //out(n1 << " " << n2 << " " << op);
    if (op == '-') {
        int ti = 60 * n1 + 6 * n2;
        while (ti--) {
            if (a == 0 && b == 0) a = 24;
            if (b == 0) { a--; b = 59; continue; }
            b--;
        }
    } else {
        b += 6 * n2;
        if (b >= 60) {a++; b -= 60; }
        (a += n1) %= 24;
    }
    
    out(setw(2) << setfill('0') << a << ":" << setw(2) << setfill('0') << b);
}
0