일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- array
- Greedy
- 해설
- 추천
- 영어
- 리뷰
- parametric search
- BOJ
- 2020
- review
- 수능
- 카카오
- 알고리즘
- Recursive
- Algorithm
- coding
- 백준
- 영화
- benefits
- BFS
- usaco
- Movie
- silver
- 코딩 테스트
- health
- 완전탐색
- 넷플릭스
- kakao
- 나는솔로
- Netflix
Archives
- Today
- Total
목록power function (1)
Young
effective power function
거듭제곱을 조금 더 효율적으로 하는 recursive 함수입니다. 시간 복잡도는 O(logN) 입니다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #include #include #include #include #define endl '\n' #define FastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; typedef long long ll; ll power(int a, int b) { if (b == 0) return 1; if (b == 1) return a; ll ret = power(a, b >> 1); if (b & 1) re..
코딩 테스트 대비 추천 문제
2019. 4. 5. 19:22