[CodeForces] Square Root of Permutation : 순열 제곱근
Square Root of Permutation 목차 Square Root of Permutation 문제 설명 Solution Code 문제 설명 문제 : 코드포스 Educational Round 4, E번, Square Root of Permutation길이 n의 순열이란 1부터 n까지의 정수를 한 번씩만 포함하는 배열이다. 예를 들어 q = [4, 5, 1, 2, 3]는 순열이다. 순열의 제곱 p란 순열 q에 대해서 p[i] = q[q[i]]를 의미한다. 예를 들어 q = [4, 5, 1, 2, 3] 일 때 p[1] = q[q[1]] = q[4] = 2 p[2] = q[q[2]] = q[5] = 3 p[3] = q[q[3]] = q[1] = 4 p[4] = q[q[4]] = q[2] = 5 p[5]..
문제
2016. 4. 8. 18:41
최근에 달린 댓글
- Total
- Today
- Yesterday