Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 | 31 |
Tags
- 디버그심볼
- 백준1476
- Class Delegation
- 개수 세기
- 백준1107
- 18108
- BitMasking
- 새싹
- 1330
- 25083
- 10430
- PreferenceManager
- dp
- 백준3085
- Counting The number
- 10926
- 사파리 월드
- Android
- debugSymbolLevel
- 브루트포스
- 10807
- 기본메신저
- 코틀린
- 꼬마 정민
- 백준
- safari world
- 2525
- kotlin
- 파이썬
- baekjoon
Archives
- Today
- Total
목록1699 (1)
세상을 더 좋게
[백준] 1699 '제곱수의 합' 파이썬(python)
https://www.acmicpc.net/problem/1699 1699번: 제곱수의 합 어떤 자연수 N은 그보다 작거나 같은 제곱수들의 합으로 나타낼 수 있다. 예를 들어 11=32+12+12(3개 항)이다. 이런 표현방법은 여러 가지가 될 수 있는데, 11의 경우 11=22+22+12+12+12(5개 항)도 가능하다 www.acmicpc.net import sys import math n = int(sys.stdin.readline()) dp = [0] * (n+1) for i in range(1, n+1): dp[i] = i for j in range(1, int(math.sqrt(i))+1): if (j*j) > i : break if dp[i] > dp[i - j * j]+1: dp[i] = ..
Algorithm/DP
2021. 12. 8. 00:00