-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboj_1138.java
More file actions
29 lines (25 loc) · 809 Bytes
/
boj_1138.java
File metadata and controls
29 lines (25 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package backtracking;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
public class boj_1138 {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(br.readLine());
int[] arr=new int[n];
List<Integer> res=new ArrayList<>();
StringTokenizer st=new StringTokenizer(br.readLine()," ");
for(int i=0;i<n;i++){
arr[i]=Integer.parseInt(st.nextToken());
}
for(int i=n-1;i>=0;i--){
res.add(arr[i],i+1);
}
for(int k:res){
System.out.print(k+" ");
}
}
}