結果

問題 No.652 E869120 and TimeZone
ユーザー Lepton_sLepton_s
提出日時 2018-02-23 22:29:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,268 bytes
コンパイル時間 1,003 ms
コンパイル使用メモリ 120,092 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-22 14:06:36
合計ジャッジ時間 2,275 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
4,380 KB
testcase_20 WA -
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 WA -
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 WA -
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#pragma GCC optimize ("O3")
//#pragma GCC target ("tune=native")
//#pragma GCC target ("avx")
//#include <bits/stdc++.h>
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<P,ll> PPI;
typedef pair<ll,P> PIP;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
#define PQ(T) priority_queue<T,vector<T>,greater<T>>
#define PQ2(T) priority_queue<T>
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i))
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) ((x)=min((x),(y)))
#define chmax(x,y) ((x)=max((x),(y)))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
#define DEBUG(x) cerr<<"line ("<<__LINE__<<")  "<<#x<<": "<<x<<endl;
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);

int main(){
	ll a, b;
	string s;
	cin>>a>>b>>s;
	ll t = (a-9)*60+b;
	s = s.substr(3);
	int sign = s[0]=='+'?1:-1;
	s = s.substr(1);
	int l = s.size();
	{
		stringstream ss;
		if(1<l&&s[l]!='.'){
			ss = stringstream(s.substr(0, 2));
			s = s.substr(2);
		} else {
			ss = stringstream(s.substr(0, 1));
			s = s.substr(1);
		}
		ll x;
		ss>>x;
		t += x*60*sign;
	}
	{
		l = s.size();
		if(l>0){
			stringstream ss(s.substr(1));
			ll x;
			ss>>x;
			t += x*6*sign;
		}
	}
	t %= 24*60;
	if(t<0) t += 24*60;
	printf("%02d:%02d\n", t/60, t%60);
	return 0;
}
0