結果

問題 No.652 E869120 and TimeZone
ユーザー LiesegangLiesegang
提出日時 2018-02-24 00:13:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,238 bytes
コンパイル時間 764 ms
コンパイル使用メモリ 89,524 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-17 13:37:25
合計ジャッジ時間 1,636 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 20 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <bitset>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
#include <limits>

using namespace std;
using ll=long long;
using vint=vector<int>;
using pint=pair<int,int>;

const double EPS = 1e-9;
const int inf = numeric_limits<int>::max();

#define rep(i,n) for(int i=0;i<int(n);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,i,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl

void solve(){
	int a, b;
	string s;
	cin >> a >> b >> s;
	int c, d;
	int dot = s.rfind(".");
	if(dot != -1){
		if(dot == 6){
			c = s[4] - '0';
			c *= 10;
			c += s[5] - '0';

			d = s[7] - '0';
		}else{
			c = s[4] - '0';

			d = s[6] - '0';
		}
	}else{
		if(s.length() == 6){
			c = s[4] - '0';
			c *= 10;
			c += s[5] - '0';
		}else{
			c = s[4] - '0';
		}
		d = 0;
	}

	if(s[3] == '-'){
		c = -c;
		if(d != 0){
			--c;
		}
		d = 10-d;
	}

	a -= 9;
	a += c + 24;
	a %= 24;

	b += 6 * d + 60;
	b %= 60;

	printf("%02d:%02d\n", a, b);
}

//UTC+00

int main(){
	solve();
	return 0;
}
0