'알고리즘 모음집/알고리즘 (Algorithm)' 카테고리의 글 목록 (2 Page)
본문 바로가기
728x90
반응형

알고리즘 모음집/알고리즘 (Algorithm)88

1258 행렬찾기 #include #include #include #include #include using namespace std; #define NS 102 int map[NS][NS]; int chk[NS][NS]; int N; int ret; int dy[] = { 0,1,0,-1 }; int dx[] = { 1,0,-1,0 }; struct Data { int size, y, x; }; bool cmp(Data a, Data b) { if (a.size == b.size)return a.y < b.y; else return a.size < b.size; } vectorv; struct Matrix { Matrix() { int T; scanf("%d", &T); for (int t = 1; t 2020. 2. 27.
1225 암호 생성기 #include #include #include using namespace std; int n; int arr[9]; int retIdx; struct Screat { Screat() { int t; while (cin >> t) { init(); for (int i = 0; i < 8; i++) { scanf("%d",&arr[i]); } arrCircle(); printf("#%d ", t); int cnt = 0; for (int i = 0; i < 8; i++) { printf("%d ", arr[retIdx++]); if (retIdx == 8)retIdx = 0; } printf("\n"); } } void init() { memset(arr, 0, sizeof(arr)); retIdx = .. 2020. 2. 27.
1486 장훈이의 높은 선반 알고리즘 #include #include #include using namespace std; #define NS 21 int member[NS]; int N, B; int ret; int Min = 0x7fffffff; struct Seo { Seo() { int T; scanf("%d", &T); for (int t = 1; t = B) { if (Min > (sum - B))Min = (sum - B); } return; } dfs(sum + member[idx], idx + 1); dfs(sum, idx + 1); } }Seo; int main(void) { return 0; } 이문제의 포인트는 재귀로 넣고 빼고를 구현 할 수 있는지 입니다. 소스를 직접보면 어처구니 없이 너무나 쉬운데 이정도는 기본으로.. 2020. 2. 27.
[모의 SW 역량테스트] 원자 소멸 시뮬레이션 #include #include #include #include using namespace std; int ret; int dy[] = { 1,-1,0,0 }; int dx[] = { 0,0,-1,1 }; struct Data { int y, x, dir, k; }; bool cmp(Data a, Data b) { if (a.y == b.y)return a.x 2000 || v[idx].x 2000)return true; else return false; } void move() { for (int .. 2019. 12. 20.
728x90
반응형