結果

問題 No.652 E869120 and TimeZone
ユーザー nnasennnasen
提出日時 2018-02-24 03:16:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 868 bytes
コンパイル時間 1,464 ms
コンパイル使用メモリ 167,956 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-22 14:33:33
合計ジャッジ時間 2,644 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n) - 1; (i) >= 0; --i)
#define SZ(n) (int)(n).size()
#define ALL(n) (n).begin(), (n).end()
#define MOD LL(1e9 + 7)
#define INF 1000000
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PI;

int main() {
	int a, b;
	string s;
	cin >> a >> b >> s;
	double t = stoi(s.substr(3, s.length() - 3));
	if (s[s.size() - 2] == '.')
		t += (s[s.length() - 1] - '0') * 0.1;
	t -= 9;
	b += t * 60;
	while (b >= 60) {
		a++;
		b -= 60;
	}
	while (b < 0) {
		a--;
		b += 60;
	}
	if (a > 24) 
		a -= 24;
	if (a < 0) 
		a += 24;
	string h = to_string(a);
	string m = to_string(b);
	if (h.length() == 1) 
		h.insert(0, "0");
	if (m.length() == 1) 
		m.insert(0, "0");
	cout << h << ":" << m << endl;	return 0;
}
0