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
- ์ฌ๊ท
- error
- GCP
- ๋์ ํฉ
- ๋ฐฑํธ๋ํน
- ๊ทธ๋ฆฌ๋
- OS
- web
- dfs
- thymeleaf
- CVE
- dynamic debugging
- ์ต๋จ ๊ฒฝ๋ก
- Spring
- c++
- JPA
- ์๋ฎฌ๋ ์ด์
- Reversing
- ๋ถํ ์ ๋ณต
- ๋ฌธ์์ด
- ์ด๋ถ ํ์
- ๋ฐ์ดํฌ์คํธ๋ผ
- BFS
- ์คํ
- ์ฐ์ ์์ ํ
- ๊ตฌํ
- ์์ ์ ๋ ฌ
- DP
- java
- ๋งต
Archives
- Today
- Total
๋ชฉ๋ก๐ PS/Algorithm (71)
hades

๐ฅ ๋ฌธ์ https://www.acmicpc.net/problem/11047 ๐ ์ค๊ณK๋ฅผ ๋ฌ์ฑ์ํค๋ ๋์ ์ ์ต์ ๊ฐ์๋ฅผ ๊ตฌํด์ผ ํ๋๋ฐ, A1 = 1, i ≥ 2์ธ ๊ฒฝ์ฐ์ Ai๋ Ai-1์ ๋ฐฐ์๋ผ๋ ์กฐ๊ฑด์ด ์์ผ๋ฏ๋ก, ๊ฐ์น๊ฐ ํฐ ๋์ ๋ถํฐ ์ต๋ํ ์ฌ์ฉํ๋ ๊ทธ๋ฆฌ๋ ๋ฌธ์ ๋ผ๋ ๊ฒ์ ํ์ ํ ์ ์๋ค. ๐ ํ์ด#include #include #include #include using namespace std;int n, k, result = 0;vector coins(10);int main() { cin >> n >> k; for (int i=0; i> coins[i]; } for (int i=n-1; i>=0; i--){ result += k / coins[i]; k %= coins[i]; } cout
๐ PS/Algorithm
2024. 7. 1. 13:36