File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 1
- // Authored by : BaaaaaaaaaaarkingDog
1
+ // Authored by : heheHwang
2
2
// Co-authored by : -
3
- // http://boj.kr/****************
3
+ // http://boj.kr/11adde96fad94208aa79c918e89e3a9e
4
4
#include < bits/stdc++.h>
5
5
using namespace std ;
6
+ typedef long long ll;
6
7
7
- int main (void ){
8
+ ll n, m, two, five;
9
+ ll find (ll num, int p){
10
+ ll rtn = 0 , div = p;
11
+ while (num / div) {
12
+ rtn += (num / div);
13
+ div *= p;
14
+ }
15
+ return rtn;
16
+ }
17
+ int main (void ) {
8
18
ios::sync_with_stdio (0 );
9
19
cin.tie (0 );
10
-
20
+
21
+ cin >> n >> m;
22
+ two = find (n, 2 ) - find (m, 2 ) - find ((n - m), 2 );
23
+ five = find (n, 5 ) - find (m, 5 ) - find ((n - m), 5 );
24
+ cout << min (two, five);
11
25
}
Original file line number Diff line number Diff line change 1
1
# 수학
2
2
3
- ![ 100%] ( https://progress-bar.dev/9 /?scale=38&title=progress&width=500&color=babaca&suffix=/38 )
3
+ ![ 100%] ( https://progress-bar.dev/10 /?scale=38&title=progress&width=500&color=babaca&suffix=/38 )
4
4
5
5
[ 문제집 링크] ( https://www.acmicpc.net/workbook/view/8174 )
6
6
29
29
| 2960 | [ 에라토스테네스의 체] ( https://www.acmicpc.net/problem/2960 ) | - |
30
30
| 9613 | [ GCD 합] ( https://www.acmicpc.net/problem/9613 ) | - |
31
31
| 1057 | [ 토너먼트] ( https://www.acmicpc.net/problem/1057 ) | - |
32
- | 2004 | [ 조합 0의 개수] ( https://www.acmicpc.net/problem/2004 ) | - |
32
+ | 2004 | [ 조합 0의 개수] ( https://www.acmicpc.net/problem/2004 ) | [ 정답 코드 ] ( ../0x12/solutions/2004.cpp ) |
33
33
| 1292 | [ 쉽게 푸는 문제] ( https://www.acmicpc.net/problem/1292 ) | - |
34
34
| 1790 | [ 수 이어 쓰기 2] ( https://www.acmicpc.net/problem/1790 ) | - |
35
35
| 3036 | [ 링] ( https://www.acmicpc.net/problem/3036 ) | - |
You can’t perform that action at this time.
0 commit comments