結果
| 問題 |
No.652 E869120 and TimeZone
|
| コンテスト | |
| ユーザー |
donkorin_
|
| 提出日時 | 2018-09-22 13:27:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,509 bytes |
| コンパイル時間 | 1,506 ms |
| コンパイル使用メモリ | 170,412 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 08:55:26 |
| 合計ジャッジ時間 | 2,376 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 29 WA * 1 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(a);i>(b);--i)
#define eper(i,a,b) for(int i=(a);i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF (1<<31)-1
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
#define vii vector<int>
#define vll vector<long long>
using namespace std;
typedef long long ll;
typedef pair<int,int> Pii;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}
int a, b;
string s;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> a >> b >> s;
int utc_time = a - 9;
double utc_munite = b;
double diff = stod(s.substr(4, s.size()-4));
if (s[3] == '-') diff = -diff;
utc_time += (int)floor(diff);
utc_munite += 60.0 * (diff - floor(diff));
if (utc_munite > 59) {
utc_time += utc_munite / 60;
}
if (utc_time < 0) {
utc_time = 24 + utc_time;
} else if (23 < utc_time) {
utc_time -= 24;
}
int munite = (int)round(utc_munite) % 60;
cout << (utc_time < 10 ? "0" + to_string(utc_time) : to_string(utc_time)) <<
":" << (munite < 10 ? "0" + to_string(munite) : to_string(munite)) << endl;
return 0;
}
donkorin_