์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- ์ฌ๊ท
- ๋ฐฑํธ๋ํน
- ๊ตฌํ
- DP
- ๋ถํ ์ ๋ณต
- ๋งต
- Spring
- web
- JPA
- error
- ์์ ์ ๋ ฌ
- BFS
- ์ต๋จ ๊ฒฝ๋ก
- ์๋ฎฌ๋ ์ด์
- ๋์ ํฉ
- dfs
- ์ฐ์ ์์ ํ
- OS
- ๋ฐ์ดํฌ์คํธ๋ผ
- CVE
- ์คํ
- thymeleaf
- java
- dynamic debugging
- ๊ทธ๋ฆฌ๋
- ์ด๋ถ ํ์
- Reversing
- c++
- ๋ฌธ์์ด
- GCP
- Today
- Total
๋ชฉ๋ก๐ PS (125)
hades
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๐ฅ ์ค๊ณhttps://www.acmicpc.net/problem/1920 ๐ ๋ถ์์์ ๊ฐ์๊ฐ ์ต๋ 100000๊ฐ์ด๊ณ , ์ฐพ์ผ๋ ค๋ ์์ ๊ฐ์๊ฐ ์ต๋ 100000๊ฐ์ด๋ฏ๋ก, ์์ฐจ ํ์์ ํ ๊ฒฝ์ฐ, O(10^10)์ผ๋ก ์๊ฐ ์ ํ์ ์ด๊ณผํ๋ค. ๋ฐ๋ผ์, ์ด๋ถ ํ์์ ํ์ฉํ๋ค. ๐ ํ์ด #include #include #include using namespace std; int n, m, target; vector numbers(100001); bool binary_search(int target){ int start = 0, end = n-1, mid; while (start target) { end = mid - 1; } } return false; } int main() { cin...
๐ฅ ๋ฌธ์ https://www.acmicpc.net/problem/1463 ๐ ์ค๊ณ์๊ฐ ์ ํ์ด 0.15์ด์ด๊ณ , N์ด ์ต๋ 1000000์ด๋ฏ๋ก, ๋ณดํต 1์ด ๋น 1์ต ๋ฒ์ ์ฐ์ฐ์ ํ๊ธฐ ๋๋ฌธ์ ์ฌ๊ทํจ์๋ฅผ ์ฌ์ฉํ๋ค๋ฉด, Ω(N^2)์ ์๊ฐ ๋ณต์ก๋๋ก ์๊ฐ ์ ํ์ ์ด๊ณผํ๋ค. N์์ ์์ํ๋ ๊ฒ์ด ์๋๋ผ, ๋ฐ๋๋ก 1์์ ์์ํ์ฌ ๋ฌธ์ ์์ ์ฃผ์ด์ง ์ฐ์ฐ์ ๋ฐ๋๋ก ํ์ฌ ๋ค์ด๋๋ฏน ํ๋ก๊ทธ๋๋ฐ์ผ๋ก ์ค๊ณํ๋ค๋ฉด, O(N)์ผ๋ก ํด๊ฒฐํ ์ ์๋ค. ๐ ํ์ด#include #include #include using namespace std;int n, INF = 1e9+7;vector dp(1000001, INF);int main() { cin >> n; dp[1] = 0; for (int i=1; idp[i]๋ i๋ก๋ถํฐ 1์ ๋ง๋ค๊ธฐ ..
๐ฅ ๋ฌธ์ https://www.acmicpc.net/problem/1926 ๐ ์ค๊ณ1๋ก ์ด๋ฃจ์ด์ง ์์ญ์ ๊ฐ์์ ๋์ด๋ฅผ ๊ณ์ฐํด์ผ ํ๋ค. 1๋ก ๊ตฌ์ฑ๋ ์ด๋ค ์นธ์์ ๊ฐ๋ก์ธ๋ก์ ์ธ์ ํ 1์ ๊ณ์ํด์ ์ถ๊ฐํ์ฌ ํ๋์ ์์ญ์ ๊ตฌ์ฑํด์ผ ํ๋ฏ๋ก, BFS๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค. ๋ํ์ง๋ฅผ ๊ตฌ์ฑํ๋ ์นธ์ ์ ๋ณด๋ฅผ ์ ๋ ฅ๋ฐ๋๋ค. ํ ์นธ์ฉ ๋ฐ๋ณต๋ฌธ์ ํตํด ์ํํ๋ฉด์, 1์ด๋ผ๋ฉด ๊ทธ ์นธ์ ํ ๊ทธ๋ฆผ์ ์ด๋ฃจ๋ ์์์ ์ผ๋ก ํ์ฌ ํ ๊ทธ๋ฆผ์ ๋์ด๋ฅผ ๋ฐํํ๋ bfs ํจ์๋ฅผ ์คํํ๋ค. ๋ฐฉ๋ฌธ ์ฌ๋ถ๋ฅผ ์ ์ฅํ๋ visited ๋ฐฐ์ด์ ๋ง๋ค ์๋ ์์ผ๋, ๊ณต๊ฐ ๋ณต์ก๋๋ฅผ ์ค์ด๊ธฐ ์ํด 1์ด์๋ ์นธ์ ๋ฐฉ๋ฌธํ์์ผ๋ฉด 0์ผ๋ก ๋ฐ๊พธ๋ ๋ฐฉ์์ผ๋ก ์์ฑํ์๋ค. ๐ ํ์ด#include #include #include #include using namespace std;int..

๐ฅ ๋ฌธ์ 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
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.