일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- DateTime
- 위클리 챌린지
- Combinations
- BFS
- backjoon
- Set
- 그리디
- programmers
- 정규식
- 수학
- 정렬
- python
- 동적 계획법
- 카카오
- java
- 다익스트라
- 파이썬
- 추석맞이 코딩챌린지
- dfs
- lambda
- Re
- heapq
- Zip
- 백준
- 이분탐색
- 재귀함수
- 프로그래머스
- KAKAO BLIND RECRUITMENT
- 자바
- divmod
Archives
- Today
- Total
상상쓰
[백준] 인공지능 시계 본문
https://www.acmicpc.net/problem/2530
2530번: 인공지능 시계
첫째 줄에 종료되는 시각의 시, 분, 초을 공백을 사이에 두고 출력한다. (단, 시는 0부터 23까지의 정수이며, 분, 초는 0부터 59까지의 정수이다. 디지털 시계는 23시 59분 59초에서 1초가 지나면 0시 0
www.acmicpc.net
datetime 을 이용하여 시간을 설정하고 시간을 연산할 수도 있다.
import sys, datetime
h, m, s = map(int, sys.stdin.readline().split())
seconds = int(sys.stdin.readline())
now = datetime.datetime(2021, 8, 19, h, m, s)
answer = now + datetime.timedelta(seconds=seconds)
print(answer.hour, answer.minute, answer.second)
'Coding Test' 카테고리의 다른 글
[프로그래머스] 문자열 압축 (0) | 2021.08.20 |
---|---|
[프로그래머스] 신규 아이디 추천 (0) | 2021.08.19 |
[백준] 초콜릿 자르기 (0) | 2021.08.19 |
[프로그래머스] 3주차_퍼즐 조각 채우기 (0) | 2021.08.18 |
[백준] 터렛 (0) | 2021.08.17 |
Comments