알고리즘/암기(91)
-
달팽이 배열
문제링크: https://www.acmicpc.net/problem/1913 https://github.com/surinoel/algorithm/blob/master/1913.cpp
2019.04.06 -
골드바흐의 추측
미해결 정수론으로서 4보다 큰 모든 짝수는 두 홀수 소수의 합으로 나타낼 수 있다는 내용을 담고 있다 문제링크: https://www.acmicpc.net/problem/6588 https://github.com/surinoel/algorithm/blob/master/6588.cpp 문제링크: https://www.acmicpc.net/problem/2581 https://github.com/surinoel/algorithm/blob/master/2581.cpp
2019.04.02 -
소수 알고리즘
1. N이 소수인지 판별하는 알고리즘 N이 소수가 아니라면, a*b (a, b는 2 이상의 자연수)로 나타낼 수 있다 a가 b보다 작을 때, a는 최대 루트 N, b는 최소 루트 N으로 표시할 수 있다 따라서 최대 루트 N까지 나머지 연산을 검사하면 소수인지 아닌지 판별할 수 있다. https://github.com/surinoel/algorithm/blob/master/1978.cpp 12345678910111213#include int main(void) { int n = 111; for (int i = 2; i*i
2019.04.02 -
배열 돌리기 (우)
동적할당 시 memcpy는 행마다 해야된다. 동적할당의 의미를 잘 파악하면 이유를 알 수 있다. https://github.com/surinoel/algorithm/blob/master/rotatearr_malloc_right.cpp
2019.04.01 -
배열 돌리기 malloc
https://github.com/surinoel/algorithm/blob/master/rotatearr_malloc.cpp
2019.04.01 -
배열 돌리기
https://github.com/surinoel/algorithm/blob/master/rotatearr.cpp
2019.04.01