8000 Update 2839.cpp · sihyeon-kim/basic-algo-lecture@b74e8ac · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit b74e8ac

Browse files
author
Haneul Kim
authored
Update 2839.cpp
1 parent 671bbfb commit b74e8ac

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

0x12/solutions/2839.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : haneulkimdev
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/3649d2bc821d41be958cb51fc82946d3
44
#include <bits/stdc++.h>
55
using namespace std;
66

7-
int main(void){
7+
int main(void) {
88
ios::sync_with_stdio(0);
99
cin.tie(0);
10-
11-
}
10+
int n;
11+
cin >> n;
12+
int ans = 0;
13+
while (n >= 0) {
14+
if (n % 5 == 0) {
15+
ans += n / 5;
16+
cout << ans;
17+
return 0;
18+
}
19+
n -= 3;
20+
ans++;
21+
}
22+
cout << -1;
23+
}

0 commit comments

Comments
 (0)
0