結果

問題 No.652 E869120 and TimeZone
ユーザー e869120
提出日時 2017-09-28 11:28:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 353 bytes
コンパイル時間 1,702 ms
コンパイル使用メモリ 168,712 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-17 12:45:50
合計ジャッジ時間 2,702 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 29 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int a,b,c;string S,T;
int main(){
	cin>>a>>b>>S;T=S.substr(4,S.size()-4);
	if(T.size()<=2){c=stoi(T)*60;}
	else{c=stoi(T.substr(0,T.size()-2))*60;c+=(T[T.size()-1]-'0')*6;}
	if(S[3]=='-')c*=-1;c-=540;c*=-1;
	int d=a*60+b-c;if(d<0)d+=1440;else if(d>1440)d-=1440;
	printf("%02d:%02d\n",d/60,d%60);
	return 0;
}
0