![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmP3XP%2FbtqZSvN6tvf%2FQnEk2Wi0KrMJfqR6cQtmh1%2Fimg.png)
[c++] BOJ 12865 :: ํ๋ฒํ ๋ฐฐ๋ญ
๋์ด๋ : ๊ณจ๋ 5 ๊ฑธ๋ฆฐ ์๊ฐ : 1์๊ฐ ๋ฐ ์ด์ ๋ฌธ์ ๋ฌธ์ ๋ฐ๋ก๊ฐ๊ธฐ ์ค๋ต ์ฒ์์ ์์ ํ์์ผ๋ก ํ๋ ์ต๋ํ ์กฐํฉ์ ๋ฒ์๋ฅผ ์ค์ฌ์ ๊ตฌํํด๋ณด์๋ค. ํ์ง๋ง, ์๊ฐ ์ด๊ณผ๋ก ์คํจ..! #include #include #include #include using namespace std; // 6์ 4๋ถ ์์ => 6์ 42๋ถ ์ค๋จ, 11์ 12๋ถ ์์ => // N > K; for (int i = 0; i > w >> v; vec.push_back(make_pair(w, v)); } // ๋ฌด๊ฒ ์ ์ ๋ ฌ sort(vec.begin(), vec.end(), compare); // ๋ฌด๊ฒ๋ ๊ฐ์๋ฐ ๊ฐ์น๊ฐ ์์ ๊ฒ์ ์์ ๊ธฐ for (int i = 1; i < vec.size(..
Comment