結果
| 問題 | No.652 E869120 and TimeZone |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-20 00:24:05 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 441 bytes |
| 記録 | |
| コンパイル時間 | 2,136 ms |
| コンパイル使用メモリ | 192,764 KB |
| 最終ジャッジ日時 | 2025-01-07 14:18:35 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 2 |
| other | AC * 3 WA * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int h,m;
string s;
cin>>h>>m>>s;
int t=60*h+m-540;
int n=0;
for (int i=4;i<s.size()&&isdigit(s[i]);i++) {
n*=10;
n+=s[i]-'0';
}
int tt=60*n;
if (s[s.size()-2]=='.') tt+=6*(s[s.size()-2]-'0');
if (s[3]=='-') tt=-tt;
t+=tt;
t=(t+24*60)%(24*60);
printf("%02d:%02d\n",t/60,t%60);
return 0;
}