[백준 23291] 어항정리 #262
ghdcksgml1
started this conversation in
1일 1알고리즘
Replies: 1 comment
-
우와.. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
오랜만입니다! 다들 잘 지내시나여
간만에 시간도 좀 있고, 구현문제가 땡겨서 삼성 역테 기출좀 풀어제꼈습니다.
풀이
문제에서 하라는대로 하면됌
시간복잡도
어항의 물고기수를 정렬하거나 배열할때 N2의 시간복잡도가 소요되지만,
어항의 높이는 단계를 실행할때마다 1,1,2,2,3,3,... 이런식으로 높아지기때문에 대강
$$ \sqrt{N} $$ 정도의 시간복잡도가 소요된다.
따라서, 둘이 곱해보면 $$ N^2 * \sqrt{N} $$ 정도 걸린다.
여기서 N은 최대 100이므로 시간은 아주 널널~
소스코드
이제 플레티넘 문제를 풀어도 1점 오르네여 ㅎㅎ;;
Beta Was this translation helpful? Give feedback.
All reactions