본문 바로가기

분류 전체보기439

원자 소멸 시뮬레이션 C++ https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRFInKex8DFAUo SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com #include #include #include using namespace std; const int MAX = 4001; int n; int map[MAX][MAX]; struct INFO { int x, y, k, dir; bool alive; }; vector v; struct MOVE { int x, y; }; MOVE mv[4] = { { 1,0 },{ -1,0 },{ 0,-1 },{ 0.. 2022. 4. 29.
등산로 조성 C++ https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PoOKKAPIDFAUq #include #include #include #include using namespace std; const int MAX = 9; int map[MAX][MAX]; int n, K; struct MOVE { int x, y; }; MOVE mv[4] = { {-1,0}, {1,0}, {0,-1}, {0,1} }; int visited[MAX][MAX]; int answer; void dfs(int ii, int jj, int flag, int count) { int tmp[MAX][MAX]; for (int i = 0; i < n; .. 2022. 4. 29.
탈주범 검거 C++ https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PpLlKAQ4DFAUq SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com #include #include #include using namespace std; const int MAX = 51; int map[MAX][MAX]; int n, m; int r, c, l; int visited[MAX][MAX][4]; struct MOVE { int x, y; }; MOVE mv[4] = { {-1,0}, {1,0}, {0,-1}, {0,1} }; //상 하 좌 우 bool.. 2022. 4. 28.
점심 식사시간 C++ https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5-BEE6AK0DFAVl SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com #include #include #include using namespace std; int n; int t1=0, t2=0; vector wall; struct INFO { int x, y, w1, w2; }; vector p; vector stair[2]; int answer = 2e9; void CalAns() { int ans1 = 0; int ans2 = 0; vector s[2]; s[0.. 2022. 4. 25.