[c++] ํ๋ก๊ทธ๋๋จธ์ค - ์ผ๊ฐ ๋ฌํฝ์ด(Level 2)
๋ฌธ์ ์ฝ๋ฉํ
์คํธ ์ฐ์ต - ์ผ๊ฐ ๋ฌํฝ์ด 5 [1,2,12,3,13,11,4,14,15,10,5,6,7,8,9] 6 [1,2,15,3,16,14,4,17,21,13,5,18,19,20,12,6,7,8,9,10,11] programmers.co.kr ์ฝ๋ #include #include #include using namespace std; vector solution(int n) { vector answer; int num = 1; int move_cnt = n; int arr[1001][1001]={0,}; int x=0, y=0; for(int i=0; i
2022. 3. 14.
[c++] ํ๋ก๊ทธ๋๋จธ์ค - ์์ด ๋๋ง์๊ธฐ(Level 2)
๋ฌธ์ ์ฝ๋ฉํ
์คํธ ์ฐ์ต - ์์ด ๋๋ง์๊ธฐ 3 ["tank", "kick", "know", "wheel", "land", "dream", "mother", "robot", "tank"] [3,3] 5 ["hello", "observe", "effect", "take", "either", "recognize", "encourage", "ensure", "establish", "hang", "gather", "refer", "reference", "estimate", "executive"] [0,0] programmers.co.kr ์ฝ๋ #include #include #include #include using namespace std; vector solution(int n, vector words) { ve..
2022. 3. 4.
[c++] ํ๋ก๊ทธ๋๋จธ์ค - ๋ฐฐ๋ฌ( Level2)
๋ฌธ์ ์ฝ๋ฉํ
์คํธ ์ฐ์ต - ๋ฐฐ๋ฌ 5 [[1,2,1],[2,3,3],[5,2,2],[1,4,2],[5,3,1],[5,4,2]] 3 4 6 [[1,2,1],[1,3,2],[2,3,2],[3,4,3],[3,5,2],[3,5,3],[5,6,1]] 4 4 programmers.co.kr ์ฝ๋ #include #include #define INF 1e9 using namespace std; int solution(int N, vector road, int K) { int graph[51][51]={0, }; int answer = 0; vectormemory_city_cnt; for(int i=0; i
2021. 11. 8.