-
-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathSequenceEquation.java
More file actions
29 lines (28 loc) · 678 Bytes
/
SequenceEquation.java
File metadata and controls
29 lines (28 loc) · 678 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
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int p[] = new int[n];
for(int i=0;i<n;i++) {
p[i] = in.nextInt();
}
for(int i=1;i<=n;i++) {
int j=0;
int k=0;
for(;j<n;j++) {
if(p[j]==i)
break;
}
for(;k<n;k++) {
if(p[k]==j+1)
break;
}
System.out.println(k+1);
}
}
}