This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string.h> | |
| #include <algorithm> | |
| using namespace std; | |
| int n=0, k=0; | |
| int map[20][20]; | |
| int arr[20]; | |
| int ans = 0; | |
| bool visited[20]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| vector<int> v[10010]; | |
| int n=0; //๋ ธ๋์ ๊ฐฏ์ | |
| bool visited[10010]; | |
| void dfs(int curr){ | |
| /*ํ์ฌ ๋ ธ๋์ edge๋ฅผ ๋ฐฉ๋ฌธํ๊ธฐ ์ */ | |
| visited[curr] = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| vector<int> v[10010]; | |
| int n=0; //๋ ธ๋์ ๊ฐฏ์ | |
| bool visited[10010]; | |
| int ans = 0; | |
| void dfs(int curr){ | |
| /*ํ์ฌ ๋ ธ๋์ edge๋ฅผ ๋ฐฉ๋ฌธํ๊ธฐ ์ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| vector<int> v[10010]; | |
| int n=0; //๋ ธ๋์ ๊ฐฏ์ | |
| bool visited[10010]; | |
| int dfs(int curr){ | |
| /*ํ์ฌ ๋ ธ๋์ edge๋ฅผ ๋ฐฉ๋ฌธํ๊ธฐ ์ */ | |
| visited[curr] = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <algorithm> | |
| using namespace std; | |
| int n=0; | |
| int input[10]; | |
| int arr[10]; | |
| int ans =0; | |
| bool visited[10]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <algorithm> | |
| using namespace std; | |
| int n=0, ans =1000000000; | |
| int input[20][2]; | |
| void recur(int depth, int choice, int x, int y){ | |
| if(depth != 0){ | |
| ans = ans > abs(x-y) ? abs(x-y) : ans; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int n=0; | |
| int input[20][2]; | |
| int ans = 0; | |
| /* | |
| depth : depth๋ ์ง์ ์ผ์ ํ ์ง ๋ง์ง ๊ฒฐ์ ํด์ผ ํ๋ค. = depth-1์ผ๊น์ง๋ ์ผ์ ์๋ฃํ ์ํ์ด๋ค. | |
| score : depth-1์ผ๊น์ง ์๋ฃํ ์ํ๊น์ง ๋ฒ ๋ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 1์๊ฐ 16๋ถ | |
| */ | |
| #include <iostream> | |
| #include <algorithm> | |
| #include <string> | |
| using namespace std; | |
| int n = 0, k=0; | |
| int ans = 0; | |
| string input[55]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string.h> | |
| using namespace std; | |
| string map[5]; | |
| int ans =0; | |
| int dx[4] = {0,0,1,-1}; | |
| int dy[4] = {1,-1,0,0}; | |
| bool selected[5][5]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string.h> | |
| using namespace std; | |
| int map[9][9]; | |
| bool flag; | |
| bool visited[10]; | |
| bool check(int x, int y){ | |
| memset(visited,false, sizeof(visited)); |