結果

問題 No.652 E869120 and TimeZone
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2019-03-10 21:14:41
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 959 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 64,120 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 19:58:18
合計ジャッジ時間 1,904 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <string>
typedef long long ll;
using namespace std;

double strNum(string s) {
    double n = 0;
    int dec = 0;
    for (int i = 0; i < (int)s.length(); i++) {
        if (s[i] == '.') {
            dec = true;
        }
        else if (dec){
            double d = 1;
            for(int i = 0; i < dec; i++)
            {
                d *= 0.1;
            }
            n += (s[i] - '0') * d;
            dec++;
        }
        else if (s[i] - '0' >= 0 && s[i] - '0' <= 9){
            n *= 10;
            n += (s[i] - '0');
        }
    }
    if (s[0] == '-') {
        n *= -1;
    }
    return n;
}

int main(){
    int a,b,t;
    string s;
    cin >> a >> b >> s;
    t = 24 * 60 + (int)(a * 60 + b - (9 - strNum(s.substr(3,s.length()-3))) * 60);
    t %= 24 * 60;
    cout << t/60%24/10 << t/60%24%10 << ":" << t%60/10 << t%60%10 << endl;
    return 0;
}
0