Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. using namespace std;
  2. int main() {
  3. /* Enter your code here. Read input from STDIN. Print output to STDOUT */
  4. int n = 0, index=0;
  5. scanf("%d", &n);
  6.  
  7. vector <int> arr(n); // Create a hash table to store the value
  8. for(int i=0; i<n;i++){
  9. scanf("%d", &index);
  10. arr[index - 1] = i;
  11. }
  12.  
  13. for(int x=0; x<n; x++){
  14. cout << arr[arr[x]] + 1 << endl;
  15. }
  16.  
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement