프래머스 - 다단계 칫솔 판매 더보기 #include #include #include using namespace std; constexpr int PRICE = 100; vector solution(vector enroll, vector referral, vector seller, vector amount) { vector answer; answer.resize(enroll.size(), 0); unordered_map IDs; int ID = 0; for(auto en : enroll) IDs[en] = ID++; vector parents(enroll.size()); //추천인을 다단계 tree상의 부모로 간주 for(int i=0;i> m; BufferedFenwickTree bft(n,m); f..