結果

問題 No.652 E869120 and TimeZone
コンテスト
ユーザー autumn-eel
提出日時 2018-02-23 22:28:20
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 394 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,554 ms
コンパイル使用メモリ 183,960 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-01-29 13:05:53
合計ジャッジ時間 2,615 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;

int main(){
	int a,b;cin>>a>>b;
	string s;cin>>s;
	string t=s.substr(4);
	double d=stod(t);
	int tim=a*60+b;
	tim+=1440;
	tim-=60*9;
	tim%=1440;
	if(s[3]=='+'){
		int q=tim+d*60;
		q%=1440;
		printf("%02d:%02d\n",q/60,q%60);
	}
	else{
		int q=tim+1440-d*60;
		q%=1440;
		printf("%02d:%02d\n",q/60,q%60);
	}
}
0