We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */intn;scanf("%d",&n);int*y=(int*)malloc(sizeof(int)*n);int*a=(int*)malloc(sizeof(int)*n);for(inti=1;i<=n;i++){scanf("%d",&y[i]);}for(inti=1;i<=n;i++){a[i]=f(y[f(y[i])]);printf("%d\n",a[i]);}return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Security Permutations
You are viewing a single comment's thread. Return to all comments →
define f(x) x