Skip to content

Commit 2329ca2

Browse files
committed
[Silver V] Title: 팩토리얼 0의 개수, Time: 108 ms, Memory: 14604 KB -BaekjoonHub
1 parent 66b997d commit 2329ca2

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

백준/Silver/1676. 팩토리얼 0의 개수/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
### 성능 요약
66

7-
메모리: 14720 KB, 시간: 112 ms
7+
메모리: 14604 KB, 시간: 108 ms
88

99
### 분류
1010

1111
수학
1212

1313
### 제출 일자
1414

15-
2025년 2월 28일 00:20:10
15+
2025년 2월 28일 00:22:44
1616

1717
### 문제 설명
1818

백준/Silver/1676. 팩토리얼 0의 개수/팩토리얼 0의 개수.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,23 @@
44

55
public class Main {
66
// static Long sum;
7+
static BigInteger factorial;
78
static int N, cnt;
89

910
public static void main(String[] args) throws IOException{
1011
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
11-
1212
N = Integer.parseInt(br.readLine());
1313

14-
// sum=1L;
15-
16-
BigInteger factorial = BigInteger.ONE;
14+
factorial = BigInteger.ONE;
1715

1816
for(int i=1; i<=N; i++){
1917
factorial = factorial.multiply(BigInteger.valueOf(i));
20-
// sum *= i;
2118
}
2219

2320
String s = factorial.toString();
2421

25-
// String s = Long.toString(sum);
2622
cnt=0;
2723

28-
29-
// System.out.println(s);
3024
for(int i=s.length()-1; i>0; i--){
3125
if(s.charAt(i) == '0'){
3226
cnt++;

0 commit comments

Comments
 (0)