All Tracks Algorithms Sorting Bubble Sort Problem

C.Sort it out!
Tag(s):

Easy

Problem
Editorial
Analytics

You are given an array of non-negative integers of size m. Your task is to sort the array in non-decreasing order and print out the original indices of the new sorted array.

Example:

A={4,5,3,7,1}

After sorting the new array becomes A={1,3,4,5,7}.

The required output should be "4 2 0 1 3"   

INPUT :

The first line of input consists of the size of the array

The next line consists of the array of size m

OUTPUT :

Output consists of a single line of integers

CONSTRAINTS:

1<=m<=106

0<=A[i]<=106

NOTE: The indexing of the array starts with 0.

SAMPLE INPUT
5
4 5 3 7 1
SAMPLE OUTPUT
4 2 0 1 3
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications

?