목록SW Expert Academy (9)
Study hard
[문제] swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV15QRX6APsCFAYD&categoryId=AV15QRX6APsCFAYD&categoryType=CODE SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com [풀이] dfs를 사용하면 시간 초과가 뜬다. bfs를 사용하여 (N-1,N-1)에 도달하면 가장 짧은 복구시간을 갱신하여 그 다음 부터 최소 복구시간보다 초과되는 경로는 잘라주며 탐색하였다. #include #include //memset #include #include using namespace std; struct ..
[문제] swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWHPkqBqAEsDFAUn&categoryId=AWHPkqBqAEsDFAUn&categoryType=CODE SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com [풀이] 처음엔 set을 써서 dfs로 조합을 구하는 방식으로 풀려고 했지만 시간 초과가 떴다. 그래서 for문만 써서 아직 나오지 않은 점수만 vector에 넣는 방식으로 풀었다. #include #include #include //memset using namespace std; bool check[10001]; int..
[문제] swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV7I5fgqEogDFAXB SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com [풀이] dfs로 풀 수 있는 문제 중복을 피하기 위해 set을 사용하였다. 0부터 시작하는 숫자도 세야 하므로 자료형으로 string을 사용하였다. #include #include #include using namespace std; int T; char Map[4][4]; const int dx[] = { -1,1,0,0 }; const int dy[] = { 0,0,-1,1 }; sets; void..