답안 #96664

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
96664 2019-02-10T17:03:00 Z noneTP Titlovi (COCI19_titlovi) Python 3
50 / 50
23 ms 3432 KB
def go(a, b):
	result = ""
	l = len(str(a))
	for i in range(b-l):
		result += '0'
	result += str(a)
	return result

def abcde(x):
	result = ""
	a = int(l[i][x+0] + l[i][x+1])
	b = int(l[i][x+3] + l[i][x+4])
	c = int(l[i][x+6] + l[i][x+7])
	d = int(l[i][x+9] + l[i][x+10] + l[i][x+11]);

	fuck = d + c*1000 + b*1000*60 + a*1000*60*60
	fuck += last

	a = fuck//(1000*60*60)
	fuck -= a*1000*60*60
	b = fuck//(1000*60)
	fuck -= b*1000*60
	c = fuck//(1000)
	fuck -= c*1000
	d = fuck

	result += go(a, 2) + ":" + go(b, 2) + ":" + go(c, 2) + "," + go(d, 3)
	return result

l = []
def read():
	cnt = 0
	while True:
		s = input()
		if cnt%4 == 2:
			fffff = s + '\n'
			while True:
				s = input()
				if s == '#' or s == '':
					l.append(fffff)
					l.append(s)
					cnt+=1
					if s == '#':
						s = input()
						l.append(s)
						return
					break
				else:
					fffff += s + '\n' 
		else:
			l.append(s)


		cnt += 1
read()
last = int(l[-1])
for i in range(len(l)-1):
	if i%4 != 1:
		if len(l[i]) > 0 and l[i][-1] == '\n':
			l[i] = l[i][:-1]
		print(l[i])
	else:
		result = ""
		result += abcde(0)
		result += " --> "
		result += abcde(17)
		print(result)
		


# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 3428 KB Output is correct
2 Correct 22 ms 3428 KB Output is correct
3 Correct 20 ms 3432 KB Output is correct
4 Correct 21 ms 3428 KB Output is correct
5 Correct 23 ms 3428 KB Output is correct