FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-algorithm/Implement/4-2.py at main · JONGSKY/python-algorithm · GitHub
JONGSKY
/
python-algorithm
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-algorithm
/
Implement
/
4-2.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (23 loc) · 924 Bytes
Breadcrumbs
python-algorithm
/
Implement
/
4-2.py
Copy path
File metadata and controls
30 lines (23 loc) · 924 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
29
30
# 문제
# 정수 N이 입력되면 00시00분000초부터 N시59분59초까즹 모든 시각 중에서
# 3이 하나라도 포함되는 모든 경우의 수를 구하는 프로그램을 작성하시오.
# 입력조건
# 1. 첫째 줄에 정수 N이 입력된다. (0<=N<=23)
# 출력조건
# 1. 00시 00분 00초로부터 N시 59분 59초까지의 모든 시각 중에서 3이 하나라도 포함되는 모든 경우의 수를 출력한다.
# 입력예시
# 5
#출력예시
# 11475
# 해설
# 모든 경우의 수는 86,400가지 밖에 존재하지 않음. 따라서 그냥 다 확인해도 문제 없음
# H를 입력받기
h
=
int
(
input
(
'숫자 N을 입력해주세요 : '
))
count
=
0
for
i
in
range
(
h
+
1
):
for
j
in
range
(
60
):
for
k
in
range
(
60
):
# 매 시각 안에 '3'이 포함되어 있는지 확인
if
'3'
in
str
(
i
)
+
str
(
j
)
+
str
(
k
):
count
+=
1
print
(
count
)
Back
|
FazBrowse Home
|
New Git URL