結果
| 問題 | No.652 E869120 and TimeZone | 
| コンテスト | |
| ユーザー |  tac | 
| 提出日時 | 2019-07-26 15:41:36 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,179 bytes | 
| コンパイル時間 | 1,554 ms | 
| コンパイル使用メモリ | 167,824 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-02 06:29:46 | 
| 合計ジャッジ時間 | 2,644 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 23 WA * 7 | 
ソースコード
#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);
}
            
            
            
        