File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
백준/Silver/1676. 팩토리얼 0의 개수 Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 44
55public 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 ++;
You can’t perform that action at this time.
0 commit comments