Skip to content

Commit 5bcc067

Browse files
committed
[Silver V] Title: 소수, Time: 264 ms, Memory: 32412 KB -BaekjoonHub
1 parent f1544e5 commit 5bcc067

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# [Silver V] 소수 - 1312
2+
3+
[문제 링크](https://www.acmicpc.net/problem/1312)
4+
5+
### 성능 요약
6+
7+
메모리: 32412 KB, 시간: 264 ms
8+
9+
### 분류
10+
11+
수학
12+
13+
### 제출 일자
14+
15+
2025년 3월 11일 20:06:56
16+
17+
### 문제 설명
18+
19+
<p>피제수(분자) A와 제수(분모) B가 있다. 두 수를 나누었을 때, 소숫점 아래 N번째 자리수를 구하려고 한다. 예를 들어, A=3, B=4, N=1이라면, A÷B=0.75 이므로 출력 값은 7이 된다.</p>
20+
21+
### 입력
22+
23+
<p>첫 번째 줄에 A와 B(1 ≤ A, B ≤ 100,000), N(1 ≤ N ≤ 1,000,000)이 공백을 경계로 주어진다.</p>
24+
25+
### 출력
26+
27+
<p>A÷B를 했을 때, 소숫점 아래 N번째 수를 출력한다.</p>
28+
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 1312 소수
2+
# 실버 5
3+
4+
import sys
5+
6+
a, b, n = map(int, sys.stdin.readline().split())
7+
8+
for i in range(n):
9+
a %= b
10+
a *= 10
11+
res = a // b
12+
13+
print(res)
14+
15+
# OverflowError
16+
# print(int(a / b * (10**n)) % 10)

0 commit comments

Comments
 (0)