結果
| 問題 | No.652 E869120 and TimeZone | 
| コンテスト | |
| ユーザー |  square1001 | 
| 提出日時 | 2018-02-23 22:24:13 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 715 bytes | 
| コンパイル時間 | 1,056 ms | 
| コンパイル使用メモリ | 85,848 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-11 12:17:33 | 
| 合計ジャッジ時間 | 1,924 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 30 | 
ソースコード
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int a, b; string s;
string calc(int x) {
	if (x <= 9) return "0" + to_string(x);
	return to_string(x);
}
int main() {
	cin >> a >> b >> s;
	int val1 = s[4] - 48;
	if (s.size() >= 6 && '0' <= s[5] && s[5] <= '9') val1 = val1 * 10 + s[5] - 48;
	val1 *= 10;
	if (s.size() >= 7 && '0' <= s[6] && s[6] <= '9') val1 += s[6] - 48;
	if (s.size() >= 8 && '0' <= s[7] && s[7] <= '9') val1 += s[7] - 48;
	val1 *= 6;
	if (s[3] == '-') val1 = -val1;
	int res = (a * 60 + b + val1 + 1440 + 900) % 1440;
	cout << calc(res / 60) << ":" << calc(res % 60) << endl;
	return 0;
}
            
            
            
        