์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- error
- ๋์ ํฉ
- dynamic debugging
- ์ด๋ถ ํ์
- web
- dfs
- ์ต๋จ ๊ฒฝ๋ก
- BFS
- ๋ฐฑํธ๋ํน
- CVE
- ์ฌ๊ท
- ๋งต
- ๋ฌธ์์ด
- thymeleaf
- java
- ๊ตฌํ
- ๋ถํ ์ ๋ณต
- OS
- ์ฐ์ ์์ ํ
- ์คํ
- ์์ ์ ๋ ฌ
- GCP
- ๋ฐ์ดํฌ์คํธ๋ผ
- JPA
- ๊ทธ๋ฆฌ๋
- Spring
- DP
- Reversing
- ์๋ฎฌ๋ ์ด์
- c++
- Today
- Total
๋ชฉ๋ก๐ PS (125)
hades
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๐ฅ ๋ฌธ์ https://www.acmicpc.net/problem/1620 ๐ ์ค๊ณํฌ์ผ๋ชฌ๋ค์ ์ด๋ฆ์ด ์ฃผ์ด์ง๊ณ , ์ ๋ ฅ์ด ํฌ์ผ๋ชฌ์ ์ด๋ฆ์ด๋ฉด ๋ฒํธ๋ฅผ, ๋ฒํธ์ด๋ฉด ํฌ์ผ๋ชฌ์ ์ด๋ฆ์ ์ถ๋ ฅํด์ผ ํ๋ค. C++์์ string๊ณผ int๋ฅผ ์ฐ๊ด์ง์ผ๋ฉด์๋ ์๋๊ฐ ๋น ๋ฅธ ์๋ฃ๊ตฌ์กฐ์๋ ํธ๋ฆฌ ๊ธฐ๋ฐ์ธ map์ด ์๋ค. map์ ํ์ฉํ์ฌ ํฌ์ผ๋ชฌ ๋๊ฐ์ ๋ง๋ ๋ค. key:value๊ฐ ์ด๋ฆ:๋ฒํธ, ๋ฒํธ:์ด๋ฆ์ธ ๋๊ฐ์ ๋ ๊ฐ ๋ง๋ค์ด์ ํด๊ฒฐํ๋ค. map ํด๋์ค์์ find ํจ์๋ map ์์ ์ ๋ฌํ๋ key ๊ฐ์ด ์๋ค๋ฉด, map.end()๋ฅผ ๋ฐํํ๋ค. ๐ ํ์ด#include #include #include #include #include using namespace std; int n, m;string name, target;map d..
๐ฅ ๋ฌธ์ https://www.acmicpc.net/problem/1541 ๐ ๋ถ์๊ดํธ๋ฅผ ์ณ์ ์์ ๊ฐ์ ์ต์๋ก ํด์ผ ํ๋๋ฐ, ์ต์๋ก ํ๋ ๋ฐฉ๋ฒ์ - ๋ค์ ์๋ ๊ฐ์ ๊ดํธ๋ก ๋ฌถ์ด์ฃผ๋ฉด ๋๋ค. - ๋ค์ -๊ฐ ๋์จ๋ค๋ฉด -(A+B)-(C+D)์ฒ๋ผ ์๊ฐํ๋ฉด ๋๋ค. ์ฆ, -๊ฐ ํ ๋ฒ์ด๋ผ๋ ๋์ค๋ฉด ๋ค์ ์๋ ์๋ค์ ๋นผ๊ธฐ๋ง ํ๋ฉด ๋๋ค. ์์ ๋ง์ง๋ง ์๋ฅผ ์ฒ๋ฆฌํ๊ธฐ ์ํด ๊ธฐํธ๋ฅผ ์ถ๊ฐํ๋ ๋ฐฉ์์ ์ฌ์ฉํ๋ค. ๐ ํ์ด#include #include #include #include using namespace std; string str, temp = "";bool minus_appeared = false;int result = 0;int main() { cin.tie(NULL); ios_base::sync_with_st..
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๋ณดํธ๋์ด ์๋ ๊ธ์ ๋๋ค.
๐ฅ ๋ฌธ์ https://www.acmicpc.net/problem/1260 ๐ ์ค๊ณDFS์ BFS๋ฅผ ๊ตฌํํ๋ ๊ณผ์ ์์ ์ฌ๋ฐ๋ฅด๊ฒ ์ถ๋ ฅํ๋ฉด ๋๋ ๋ฌธ์ ์ด๋ค. ๋ฐฉ๋ฌธํ ์ ์๋ ์ ์ ์ด ์ฌ๋ฌ ๊ฐ์ธ ๊ฒฝ์ฐ์๋ ์ ์ ๋ฒํธ๊ฐ ์์ ๊ฒ์ ๋จผ์ ๋ฐฉ๋ฌธํ๋ค๋ ์กฐ๊ฑด์ด ์์ผ๋ฏ๋ก, ์ฐ๊ฒฐํ ์ ์ ์ ์ ๋ ฌํด์ผ ํ๋ค. ๊ฐ์ ์ ์๊ฐ ์ต๋ 10000๊ฐ์ด๋ฏ๋ก, ์๋ฐฉํฅ์ ๊ณ ๋ คํ๋ฉด ์ด ๊ฐ์ ์ ์๋ 20000๊ฐ์ด๋ค. ์ ๋ ฌ์ ํ๋ฉด, O(NlgN)์ด๋ฏ๋ก ์๊ฐ ์ ํ์ ์ด๊ณผํ์ง ์๋๋ค. ๐ ํ์ด#include #include #include #include #include using namespace std; int n, m, v, a, b;vector> adj_list(1001);vector visited(1001);void dfs(int cur_poi..