結果
| 問題 |
No.652 E869120 and TimeZone
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-24 03:24:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 927 bytes |
| コンパイル時間 | 1,819 ms |
| コンパイル使用メモリ | 169,236 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-17 13:41:22 |
| 合計ジャッジ時間 | 2,750 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 22 WA * 8 |
ソースコード
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n) - 1; (i) >= 0; --i)
#define SZ(n) (int)(n).size()
#define ALL(n) (n).begin(), (n).end()
#define MOD LL(1e9 + 7)
#define INF 1000000
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PI;
int main() {
int a, b;
string s;
cin >> a >> b >> s;
double t = stoi(s.substr(3, s.length() - 3));
if (s[s.size() - 2] == '.')
if(t > 0)
t += (s[s.length() - 1] - '0') * 0.1;
else
t -= (s[s.length() - 1] - '0') * 0.1;
t -= 9;
b += t * 60;
while (b >= 60) {
a++;
b -= 60;
}
while (b < 0) {
a--;
b += 60;
}
if (a >= 24)
a -= 24;
if (a < 0)
a += 24;
string h = to_string(a);
string m = to_string(b);
if (h.length() == 1)
h.insert(0, "0");
if (m.length() == 1)
m.insert(0, "0");
cout << h << ":" << m << endl;
return 0;
}