8000 Merge pull request #69 from hehehwang/master · SungKweon/basic-algo-lecture@edb0330 · GitHub
[go: up one dir, main page]

Skip to content

Commit edb0330

Browse files
Merge pull request encrypted-def#69 from hehehwang/master
Update 2004.cpp
2 parents 3ed8e3c + 37faa04 commit edb0330

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

0x12/solutions/2004.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : heheHwang
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/11adde96fad94208aa79c918e89e3a9e
44
#include <bits/stdc++.h>
55
using namespace std;
6+
typedef long long ll;
67

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) {
818
ios::sync_with_stdio(0);
919
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);
1125
}

workbook/0x12.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 수학
22

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)
44

55
[문제집 링크](https://www.acmicpc.net/workbook/view/8174)
66

@@ -29,7 +29,7 @@
2929
| 2960 | [에라토스테네스의 체](https://www.acmicpc.net/problem/2960) | - |
3030
| 9613 | [GCD 합](https://www.acmicpc.net/problem/9613) | - |
3131
| 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) |
3333
| 1292 | [쉽게 푸는 문제](https://www.acmicpc.net/problem/1292) | - |
3434
| 1790 | [수 이어 쓰기 2](https://www.acmicpc.net/problem/1790) | - |
3535
| 3036 | [](https://www.acmicpc.net/problem/3036) | - |

0 commit comments

Comments
 (0)
0