[c++] ํ๋ก๊ทธ๋๋จธ์ค - ์ ๋ ฅ๋ง์ ๋๋ก ๋๋๊ธฐ(Level 2)
๋ฌธ์ ์ฝ๋ฉํ
์คํธ ์ฐ์ต - ์ ๋ ฅ๋ง์ ๋๋ก ๋๋๊ธฐ 9 [[1,3],[2,3],[3,4],[4,5],[4,6],[4,7],[7,8],[7,9]] 3 7 [[1,2],[2,7],[3,7],[3,4],[4,5],[6,7]] 1 programmers.co.kr ์ฝ๋ #include #include #include using namespace std; vectorgraph[101]; vectordivide; bool visited[101]; int group_cnt; int node_cnt[2]; void dfs(int node, pair cut){ visited[node] = 1; node_cnt[group_cnt]++; for(int i=0; i
2022. 4. 18.
[c++] ํ๋ก๊ทธ๋๋จธ์ค - ํ๋ณดํค(Level 2)
๋ฌธ์ ์ฝ๋ฉํ
์คํธ ์ฐ์ต - ํ๋ณดํค [["100","ryan","music","2"],["200","apeach","math","2"],["300","tube","computer","3"],["400","con","computer","4"],["500","muzi","music","3"],["600","apeach","music","2"]] 2 programmers.co.kr ํ์ด #include #include #include #include #include using namespace std; map uniqueness_table; vector uniqueness_vec; set candidate; bool cmp(string s1, string s2){ if(s1.length()!=s2.size()) ..
2022. 4. 17.