結果
問題 | No.652 E869120 and TimeZone |
ユーザー |
![]() |
提出日時 | 2020-11-04 04:16:53 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 40 ms / 1,000 ms |
コード長 | 1,250 bytes |
コンパイル時間 | 227 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,648 KB |
最終ジャッジ日時 | 2024-06-11 12:33:53 |
合計ジャッジ時間 | 2,218 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 30 |
ソースコード
import sys try: import os f = open('input.txt', 'r') sys.stdin = f except FileNotFoundError: None from math import sqrt, ceil,floor from collections import deque, Counter, defaultdict # defaultdict(int) input=lambda: sys.stdin.readline().strip() sys.setrecursionlimit(11451419) from decimal import ROUND_HALF_UP,Decimal #変換後の末尾桁を0や0.01で指定 #Decimal((str(0.5)).quantize(Decimal('0'), rounding=ROUND_HALF_UP)) from functools import lru_cache from bisect import bisect_left as bileft, bisect_right as biright from fractions import Fraction as frac #frac(a,b)で正確なa/b # @lru_cache(maxsize=10**10) #######ここまでテンプレ####### #ソート、"a"+"b"、再帰ならPython3の方がいい #######ここから天ぷら######## a,b,s = map(str ,input().split()) a=int(a);b=int(b) sa = Decimal(s[3:])-Decimal("9") # print(int(sa)) # print(sa) if sa<0: if abs(sa%1) <0.01: a+= int(sa) else: a+= floor(sa) hun = 1-abs(sa)%1 # print(hun) b+= hun *60 b=int(b) else: a+=int(sa) b += (sa%1)*60 b=int(b) if b>=60: b-=60 a+=1 a%=24 ji = "0"+str(a) if 0<=a<=9 else str(a) hun = "0"+str(b) if 0<=b<=9 else str(b) print(ji+":"+hun)