第二回実技検定 E - 順列
https://atcoder.jp/contests/past202004-open/tasks/past202004_e
提出
code: python
import copy
n = int(input())
a = list(map(int, input().split()))
# xをAxで変更、x=iにさえなればいい
for i in range(n):
a_copy = copy.copy(a)
ans = 0
while (a_copyi == i+1):
ans += 1
a_copyi = ai - 1
print(ans)
解答
code: python
n = int(input())
a = list(map(int, input().split()))
result = []
for i in range(n):
x = i
j = 1
x = ax - 1
while x != i:
x = ax - 1
j += 1
result.append(j)
print(*result)
メモ
AtCoder 第二回 アルゴリズム実技検定 バーチャル参戦記