[Jay] BOJ(16926): 배열 돌리기 - 문제풀이 #160
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
시간복잡도
시간 R, 가로 M, 세로 N
O(RMN)
접근과정
위 그림처럼, 각 방향을 색으로 칠해보니 규칙성이 보였습니다.
그래서 좌표 평면에서 각 방향별 공식을 구하고 이를 이용하여 여러번 회전하도록 구현하였습니다.
삽질
공식을 구하기까지 너무 삽질을 많이 했습니다.
엣지 케이스를 모두 만족하는 수식을 구하기 위해 여러번 수식을 고치면서 삽질을 했습니다.