백준 2146번 C++
#include #include #include #include using namespace std; const int MAX = 101; int n; int map[MAX][MAX]; int visited[MAX][MAX]; struct Move { int x, y; }; Move mv[4] = { {-1,0}, {1,0}, {0,1}, {0,-1} }; void dfs(int i, int j,int index) { map[i][j] = index; for (int k = 0; k = 0 && movei = 0 && movej < n) { if (v..
2019. 8. 17.
백준 1963번 C++
#include #include #include #include #include using namespace std; const int MAX = 10000; int prime[MAX]; int visited[MAX]; char increase[10] = { '0','1','2','3','4','5', '6','7','8','9' }; void calprime() { for (int i = 1000; i testcase; memset(prime, 0,sizeof(prime)); calprime(); for (int i = 0; i > first >> sec..
2019. 8. 16.