結果
問題 | No.652 E869120 and TimeZone |
ユーザー |
![]() |
提出日時 | 2018-02-23 23:39:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 886 bytes |
コンパイル時間 | 820 ms |
コンパイル使用メモリ | 84,344 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-17 13:32:23 |
合計ジャッジ時間 | 1,761 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 29 WA * 1 |
ソースコード
#include <iostream> #include <iomanip> #include <cstring> #include <algorithm> #include <math.h> #include <queue> #include <functional> #include <map> #include <vector> #include <string> using namespace std; typedef long long ll; typedef pair<int, int> P; int dx[] = { 1, 0, -1, 0 }; int dy[] = { 0, 1, 0, -1 }; const ll MOD = 1000000007; const ll INF = 100000; int a, b; string s, sa, sb; int main(void){ cin >> sa >> sb >> s; a = stoi(sa); b = stoi(sb); string s2; for (int i = 4; i < s.size(); i++) s2 += s[i]; int jtime = a * 60 + b; int time = (int)(stod(s2) * 60); int ans = 0; if (s[3] == '+') ans += jtime + time - 540; else ans += jtime - time - 540; if (ans < 0) ans += 1440; else ans %= 1440; if (ans / 60 < 10) cout << '0'; cout << ans / 60 << ':'; if (ans % 60 < 10) cout << '0'; cout << ans % 60; }