結果
| 問題 |
No.652 E869120 and TimeZone
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-07 23:54:38 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 1,000 ms |
| コード長 | 546 bytes |
| コンパイル時間 | 2,714 ms |
| コンパイル使用メモリ | 192,672 KB |
| 最終ジャッジ日時 | 2025-01-11 16:44:00 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++)
#define ALL(x) (x).begin(), (x).end()
const double PI = acos(-1);
int main() {
int a, b;
string s;
cin >> a >> b >> s;
double h = stod(s.substr(3)) - 9.0;
int hh = int(abs(h) * 10 + 0.5);
int m = 60 * (hh / 10) + (hh % 10) * 6;
int tt = 60 * a + b + m * (h >= 0 ? 1 : -1);
tt %= 1440;
if (tt < 0)
tt += 1440;
printf("%02d:%02d\n", tt / 60, tt % 60);
return 0;
}