結果
問題 | No.652 E869120 and TimeZone |
ユーザー |
![]() |
提出日時 | 2018-02-23 22:57:14 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,329 bytes |
コンパイル時間 | 743 ms |
コンパイル使用メモリ | 81,044 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 12:19:27 |
合計ジャッジ時間 | 1,804 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 30 |
ソースコード
#include<vector>#include<iostream>#include<string>#include<algorithm>#include<math.h>#include<map>#include<functional>#include<queue>#include<stack>#include<string.h>#include<list>#define MOD 10000#define INF 1000000000#define MAX 101using namespace std;typedef long long int ll;typedef pair<int,int> P;int main() {int a,b;cin>>a>>b;string s;cin>>s;int zt=0;int zm=0;if(s.length()>6){if(s[5]=='.'){zt+=(s[4]-'0');zm+=(s[6]-'0')*6;}else{zt+=(s[4]-'0')*10+(s[5]-'0');zm+=(s[7]-'0')*6;}}else if(s.length()>5){zt+=(s[4]-'0')*10+(s[5]-'0');}else{zt+=(s[4]-'0');}if(s[3]=='+'){a+=zt-9;b+=zm;}else{a-=9+zt;b-=zm;}if(b>=60){while(1){b-=60;a+=1;if(b<60){break;}}}if(b<0){while(1){b+=60;a-=1;if(b>=0){break;}}}if(a>23){a-=24;}if(a<0){a+=24;}if(a<10){cout<<0;}cout<<a<<":";if(b<10){cout<<0;}cout<<b<<endl;}