25-1 SISS/C스터디
-
[SISS/C언어 스터디] 25-1학기 4주차 스터디 - 완전 탐색, 추가 과제25-1 SISS/C스터디 2025. 4. 3. 13:15
: 4주차 (3/31~4/6) 프로그래머스 지정 1문제 (완전탐색)- https://school.programmers.co.kr/learn/courses/30/lessons/86971 전력망을 둘로 나누기#include #include #include #include #define MAX_N 100// 인접 리스트를 사용한 그래프 표현int graph[MAX_N + 1][MAX_N + 1];int visited[MAX_N + 1];// DFS를 이용하여 연결된 송전탑 개수 계산int dfs(int node, int n) { visited[node] = 1; int count = 1; for (int i = 1; i 2110→ https://www.acmicpc.net/proble..
-
[SISS/C언어 스터디] 25-1학기 3주차 스터디 - 완전 탐색, 추가 과제25-1 SISS/C스터디 2025. 3. 30. 16:30
: 3주차 (3/24~3/30) 프로그래머스 지정 2문제 (완전탐색) https://school.programmers.co.kr/learn/courses/30/lessons/86491- https://school.programmers.co.kr/learn/courses/30/lessons/87946 최소직사각형#include #include #include // 명함 크기 배열을 받아 가장 작은 지갑 크기를 계산하는 함수int solution(int** sizes, size_t sizes_rows, size_t sizes_cols) { int max_width = 0, max_height = 0; for (size_t i = 0; i max_width) max_width = w; ..
-
[SISS/C언어 스터디] 25-1학기 2주차 스터디 - 스택/큐, 추가 과제25-1 SISS/C스터디 2025. 3. 23. 20:45
: 2주차 (3/17~3/23) 프로그래머스 지정 2문제 (스택/큐)- https://school.programmers.co.kr/learn/courses/30/lessons/12909- https://school.programmers.co.kr/learn/courses/30/lessons/42584 올바른 괄호#include #include #include // 파라미터로 주어지는 문자열은 const로 주어집니다. 변경하려면 문자열을 복사해서 사용하세요.bool solution(const char* s) { int count = 0; for (int i = 0; s[i] != '\0'; i++) { if (s[i] == '(') { count++; /..
-
[SISS/C언어 스터디] 25-1학기 1주차 스터디 - 정렬, 추가 과제25-1 SISS/C스터디 2025. 3. 15. 22:00
: 1주차 (3/10~3/16) 프로그래머스 지정 1문제 (정렬)https://school.programmers.co.kr/learn/courses/30/lessons/42746 정렬 - 가장 큰 수#include #include #include int compare(const void *a, const void *b){ char str_a[10], str_b[10]; // 테스트케이스 예시의(30, 3) 앞자리 숫자끼리 비교하였을 경우 생기는 문제를 해결하기 위해 각각의 숫자가 아닌 두 숫자를 연결하여 비교 진행 sprintf(str_a, "%d%d", *(int *)a, *(int *)b); sprintf(str_b, "%d%d", *(int *)b, *(int *)a); re..