prithivMLmods/Coder-Stat huggingface dataset:
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = [None] * n
print(str(a.index(1) + 1), end=" ")
for i in range(1, n):
    print(str(a.index(i + 1) + 1), end=" ")
print()


Fixed submission:
import sys
import collections
import bisect


def main():
    n = int(input())
    A = list(map(int, input().split()))
    B = [0] * n
    for i in range(n):
        B[A[i] - 1] = str(i + 1)
    print(" ".join(B))


if __name__ == "__main__":
    main()
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = []
counter = 1
while counter <= n:
    for see in a:
        if see == counter:
            ans.append(a.index(see) + 1)
            counter += 1
            break
[print(x, end=" ") for x in ans]


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
L = {}
for i in range(len(a)):
    L[i] = a[i]
sort_L = sorted(L.items(), key=lambda x: x[1])
[print(j[0] + 1, end=" ") for j in sort_L]
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    int p = vec.at(i);
    ans.at(p) = i;
  }
  for (int i = 0; i < n; i++) {
    cout << ans.at(i) << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    int p = vec.at(i);
    ans.at(p - 1) = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cout << ans.at(i) << endl;
  }
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdlib>
#include <string>
using namespace std;

int main(void) {
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[j] == i) {
        b[i - 1] = j + 1;
      }
    }
  }

  for (int i = 0; i < n; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdlib>
#include <string>
using namespace std;

int main(void) {
  int n;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  // for(int i=1;i<=n;i++){
  //     for(int j=0;j<n;j++){
  //         if(a[j]==i){
  //             b[i-1] = j+1;
  //         }
  //     }
  // }
  for (int i = 0; i < n; i++) {
    b[a[i] - 1] = i + 1;
  }

  for (int i = 0; i < n; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI 3.14159265358979323846264338327950

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) { cin >> a[i]; }
  vector<int> ans(n);
  for (int i = 1; i <= n; i++) {
    rep(j, n) {
      if (i == a[j]) {
        ans[i - 1] = j + 1;
      }
    }
  }
  rep(i, n) { cout << ans[i] << " "; }
  cout << endl;
}


Fixed submission:
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI 3.14159265358979323846264338327950

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) { cin >> a[i]; }
  vector<int> ans(n);
  rep(i, n) { ans[a[i] - 1] = i + 1; }
  rep(i, n) { cout << ans[i] << " "; }
  cout << endl;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>
#include <cstdlib>

int main(void) {
  char l2[128];
  int N = 0;
  scanf("%d", &N);
  scanf("%c", l2);
  int answer[10001] = {};
  for (int i = 1; i < N + 1; ++i) {
    int tmp = 0;
    scanf("%d", &tmp);
    answer[tmp] = i;
  }
  for (int i = 1; i < N + 1; ++i) {
    printf("%d ", answer[i]);
  }
  return 0;
}

Fixed submission:
#include <cstdio>
#include <cstdlib>

int main(void) {
  char l2[128];
  int N = 0;
  scanf("%d", &N);
  scanf("%c", l2);
  int answer[100001] = {};
  for (int i = 1; i < N + 1; ++i) {
    int tmp = 0;
    scanf("%d", &tmp);
    answer[tmp] = i;
  }
  for (int i = 1; i < N + 1; ++i) {
    printf("%d ", answer[i]);
  }
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A.at(i) = a;
  }
  vector<int> ans(N);
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < N; j++) {
      if (A.at(j) == i) {
        ans.at(i - 1) = j + 1;
      }
    }
  }

  for (int i = 0; i < N; i++) {
    cout << ans.at(i) << ' ';
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A.at(i) = a;
  }
  vector<int> ans(N);
  for (int i = 0; i < N; i++) {
    ans.at(A.at(i) - 1) = i + 1;
  }

  for (int i = 0; i < N; i++) {
    cout << ans.at(i) << ' ';
  }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> v;
  vector<int> neww(n);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    neww[v[i - 1]] = i;
  }
  for (int i = 1; i <= n; i++) {
    cout << neww[i] << " ";
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> v;
  vector<int> neww(n + 1);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    neww[v[i - 1]] = i;
  }
  for (int i = 1; i <= n; i++) {
    cout << neww[i] << " ";
  }
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int a[10005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int k;
    cin >> k;
    a[k] = i;
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int a[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int k;
    cin >> k;
    a[k] = i;
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
x = []
x = [0 for i in range(n)]
for j in range(n):
    x.pop(a[j] - 1)
    x.insert(a[j] - 1, j + 1)
print(" ".join(map(str, x)))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
x = []
for i in range(n):
    x.append((a[i], i + 1))
x.sort()
y = []
for i in range(n):
    y.append(x[i][1])
print(" ".join(map(str, y)))
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int student[100], a_s[100];
  for (int i = 1; i <= n; i++) {
    cin >> student[i];
  }
  for (int i = 1; i <= n; i++) {
    a_s[student[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    cout << a_s[i] << " ";
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int student[1000001], a_s[1000001];
  for (int i = 1; i <= n; i++) {
    cin >> student[i];
  }
  for (int i = 1; i <= n; i++) {
    a_s[student[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    cout << a_s[i] << " ";
  }
  return 0;
}
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

ans = []
for i in range(1, N + 1):
    ans.append(A.index(i) + 1)

print(*ans)


Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

ans = [0] * N
for i in range(N):
    ans[A[i] - 1] = i + 1

print(*ans)
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
import sys

n = int(sys.stdin.readline())
alist = [int(x) for x in sys.stdin.readline().split()]
attends = [alist.index(y) + 1 for y in sorted(alist)]
print(*attends)


Fixed submission:
n = int(input())
attends = dict(enumerate(list(map(int, input().split())), start=1))
attends_sorted = sorted(attends.items(), key=lambda x: x[1])
arr = [x[0] for x in attends_sorted]
print(*arr)
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
import numpy as np

N = int(input())
A = list(map(int, input().split()))
T = [0] * N
for i in range(N):
    t = np.argmin(A)
    T[i] = t + 1
    A[t] = N + 1
print(*T)


Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
T = [0] * N
for i in range(N):
    T[A[i] - 1] = i + 1
print(*T)
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
import sys

input = sys.stdin.readline
n = int(input())
a = [int(i) for i in input().split(" ")]

sorted_a = sorted(a)
for value in sorted_a:
    print(a.index(value) + 1, end=" ")
print()


Fixed submission:
import sys

input = sys.stdin.readline
n = int(input())
a = [int(i) for i in input().split(" ")]

dict = {}
for i, value in enumerate(a):
    dict[value] = i + 1

a.sort()

for i in a:
    print(dict[i], end=" ")
print()
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
import numpy as np

n = int(input())
a_list = np.array(list(map(int, input().split())))
# a_list = np.array([3,4,2,1,5])

ans_list = a_list.argsort() + 1

ans = str(ans_list[0])
for i in ans_list[1:]:
    ans = ans + " " + str(i)

print(ans)


Fixed submission:
import numpy as np

n = int(input())
a_list = np.array(list(map(int, input().split())))
# a_list = np.array([3,4,2,1,5])

ans_list = a_list.argsort() + 1
print(" ".join(map(str, ans_list)))
Problem p02899 (Python)

Buggy submission (status: Runtime Error):
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

AA = np.argsort(A) + 1

print(AA.to_list())


Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

AA = np.argsort(A) + 1

print(*AA)
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a.at(i);

  vector<int> st;
  rep(i, n) {
    rep(j, n) {
      if (i + 1 == a.at(j)) {
        st.push_back(j + 1);
      }
    }
  }
  rep(i, n) cout << st.at(i) << " ";
  return 0;
}


Fixed submission:
#include <algorithm>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a.at(i);

  vector<int> st(n);
  rep(i, n) { st.at(a.at(i) - 1) = i; }
  rep(i, n) cout << st.at(i) + 1 << " ";
  return 0;
}
Problem p02899 (Python)

Buggy submission (status: Time Limit Exceeded):
N = int(input())
A_list = list(map(int, input().split()))
sorted_A_list = sorted(A_list)
sorted_A_list
for a in sorted_A_list:
    print(A_list.index(a) + 1, end=" ")


Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
index_add_A_list = []
for i, A in enumerate(A_list):
    index_add_A_list.append([i, A])
sorted_index_add_A_list = sorted(index_add_A_list, key=lambda x: x[1])
for a in sorted_index_add_A_list:
    print(a[0] + 1)
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];

  vector<int> res(N);
  for (int i = 1; i < N + 1; i++) {
    for (int j = 0; j < N; j++) {
      if (A[j] == i) {
        res[i - 1] = j + 1;
        break;
      }
    }
  }

  rep(i, N) {
    cout << res[i];
    if (i != N - 1)
      cout << " ";
  }
  cout << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];

  vector<int> rev(N);
  rep(i, N) rev[A[i] - 1] = i + 1;
  rep(i, N) cout << rev[i] << endl;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  vector<int> ans(n);
  for (int i = 1; i <= n; i++)
    ans[a[i - 1]] = i;
  for (int i = 1; i <= n; i++)
    cout << ans[i] << " ";
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  vector<int> ans(n);
  for (int i = 0; i < n; i++)
    ans[a[i] - 1] = i + 1;
  for (int i = 0; i < n; i++)
    cout << ans[i] << " ";
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define debug(X)                                                               \
  { cerr << '\n' << (#X) << " = " << (X) << '\n'; }
// #define cerr if(0)cerr

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a;
  vector<int> v(10010, 0);
  cin >> n;

  for (int i = 1; i <= n; ++i) {
    cin >> a;
    v[a] = i;
  }

  int i = 1;
  while (v[i]) {
    cout << v[i] << ' ';
    ++i;
  }
  cout << '\n';
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define debug(X)                                                               \
  { cerr << '\n' << (#X) << " = " << (X) << '\n'; }
// #define cerr if(0)cerr

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a;
  vector<int> v(100100, 0);
  cin >> n;

  for (int i = 1; i <= n; ++i) {
    cin >> a;
    v[a] = i;
  }

  int i = 1;
  while (v[i]) {
    cout << v[i] << ' ';
    ++i;
  }
  cout << '\n';
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
#include <vector>
int main(void) {
  int n, a;
  scanf("%d", &n);
  std::vector<int> vec(n);

  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    vec[a] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", vec[i]);
  }

  return 0;
}

Fixed submission:
#include <stdio.h>
#include <vector>
int main(void) {
  int n, a;
  scanf("%d", &n);
  std::vector<int> vec(n);

  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    vec[a - 1] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", vec[i]);
  }

  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
struct po {
  int x, y;
};
bool cmp(po a, po b) { return a.x < b.x; }
int main() {

  int n;
  while (cin >> n) {
    po a[10100];
    for (int i = 1; i <= n; i++) {
      cin >> a[i].x;
      a[i].y = i;
    }
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; i++) {
      // cout<<a[i].x<<" ";
      cout << a[i].y << " ";
    }
    cout << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
struct po {
  int x, y;
};
bool cmp(po a, po b) { return a.x < b.x; }
int main() {

  int n;
  while (cin >> n) {
    po a[101000];
    for (int i = 1; i <= n; i++) {
      cin >> a[i].x;
      a[i].y = i;
    }
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; i++) {
      // cout<<a[i].x<<" ";
      cout << a[i].y << " ";
    }
    cout << endl;
  }
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++)
    cin >> a[i];

  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[j] == i) {
        cout << j << " ";
        if (i == n) {
          cout << endl;
        }
      }
    }
  }
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++)
    cin >> a[i];

  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[j] == i) {
        cout << j << " ";
        if (i == n) {
          cout << endl;
        }
        break;
      }
    }
  }
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }

  vector<int> ans(n);

  for (int x = 0; x < n; x++) {
    for (int i = 0; i < n; i++) {
      if (a.at(i) == x + 1) {
        ans.at(x) = i + 1;
      }
    }
  }

  for (int i = 0; i < n; i++) {
    cout << ans.at(i);
    if (i == n - 1) {
      cout << endl;
    } else
      cout << " ";
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }

  vector<int> ans(n);

  for (int i = 0; i < n; i++) {
    ans.at(a.at(i) - 1) = i + 1;
  }

  for (int i = 0; i < n; i++) {
    cout << ans.at(i);
    if (i == n - 1) {
      cout << endl;
    } else
      cout << " ";
  }
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include "bits/stdc++.h"
using namespace std;

int main() {

  int N;

  cin >> N;

  vector<int> A(N);
  vector<int> B(N);

  for (int i = 0; i < N; i++) {
    A[i] = 0;
  }
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (A[j] == i + 1) {
        B[i] = j + 1;
        break;
      }
    }
  }

  for (int i = 0; i < N; i++) {
    cout << B[i] << " ";
  }
  cout << endl;

  return 0;
}


Fixed submission:
#include "bits/stdc++.h"
using namespace std;

int main() {

  int N;

  cin >> N;

  vector<int> A(N);
  vector<int> B(N);

  for (int i = 0; i < N; i++) {
    A[i] = 0;
  }
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < N; i++) {
    B[A[i] - 1] = i + 1;
  }

  for (int i = 0; i < N; i++) {
    cout << B[i] << " ";
  }
  cout << endl;

  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;
int a[10005];
int main() {
  int n, num;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> num;
    a[num] = i;
  }
  for (int i = 1; i <= n; ++i) {
    cout << a[i] << ' ';
  }
  cout << endl;
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;
int a[100005];
int main() {
  int n, num;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> num;
    a[num] = i;
  }
  for (int i = 1; i <= n; ++i) {
    cout << a[i] << ' ';
  }
  cout << endl;
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)

int main() {
  int N;
  cin >> N;

  vector<int> A(N);
  rep(i, N) cin >> A.at(i);

  vector<int> B(N);
  rep(i, N) B.at(A.at(B.at(i))) = i + 1;
  rep(i, N) cout << B.at(i) << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)

int main() {
  int N;
  cin >> N;

  vector<int> A(N);
  rep(i, N) cin >> A.at(i);

  vector<int> B(N);
  rep(i, N) B.at(A.at(i) - 1) = i + 1;
  rep(i, N) cout << B.at(i) << " ";
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <iostream>  // cout, endl, cin
#include <math.h>    // sqrt
#include <string>    // string, to_string, stoi
#include <vector>    // vector
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }
  for (int i = 1; i < N + 1; i++) {
    for (int j = 0; j < N; j++) {
      if (data.at(j) == i) {
        cout << j + 1 << " ";
        break;
      }
    }
  }
  cout << endl;
}

Fixed submission:
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <iostream>  // cout, endl, cin
#include <math.h>    // sqrt
#include <string>    // string, to_string, stoi
#include <vector>    // vector
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }
  vector<int> ans(N);
  for (int i = 0; i < N; i++) {
    ans.at(data.at(i) - 1) = i + 1;
  }
  for (int x : ans) {
    cout << x << " ";
  }
  cout << endl;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>

#define whole(f, x, ...)                                                       \
  ([&](decltype((x)) whole) {                                                  \
    return (f)(begin(whole), end(whole), ##__VA_ARGS__);                       \
  })(x)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(x) (x).begin(), (x).end()
#define INF 999999999
using namespace std;
#define lint long long

int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  vector<int> b(n + 1);
  REP(i, n) { cin >> a[i + 1]; }
  FOR(i, 1, n + 1) {
    FOR(j, 1, n + 1) {
      if (a[j] == i) {
        b[i] = j;
        break;
      }
    }
  }
  FOR(i, 1, n + 1) { cout << b[i] << " "; }
}

Fixed submission:
#include <bits/stdc++.h>

#define whole(f, x, ...)                                                       \
  ([&](decltype((x)) whole) {                                                  \
    return (f)(begin(whole), end(whole), ##__VA_ARGS__);                       \
  })(x)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(x) (x).begin(), (x).end()
#define INF 999999999
using namespace std;
#define lint long long

int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  vector<int> b(n + 1);
  REP(i, n) { cin >> a[i + 1]; }
  FOR(i, 1, n + 1) { b[a[i]] = i; }
  FOR(i, 1, n + 1) { cout << b[i] << " "; }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, a;

  cin >> n;

  vector<int> vec(10);

  for (int i = 0; i < n; ++i) {
    cin >> a;
    vec.at(a - 1) = i + 1;
  }

  for (int j = 0; j < n; ++j) {
    cout << vec.at(j);
    if (j < n - 1) {
      cout << " ";
    }
  }
  cout << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, a;

  cin >> n;

  vector<int> vec(n);

  for (int i = 0; i < n; ++i) {
    cin >> a;
    vec.at(a - 1) = i + 1;
  }

  for (int j = 0; j < n; ++j) {
    cout << vec.at(j);
    if (j < n - 1) {
      cout << " ";
    }
  }
  cout << endl;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main(void) {

  int n;
  cin >> n;
  int a[n], ans[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ans[i] = 0;
  }

  int i = 0, k = 0;

  while (k + 1 != n + 1) {
    if (i == n) {
      i = 0;
    }
    if (k + 1 == a[i]) {
      ans[k] = i + 1;
      k++;
    }

    i++;
  }

  for (int j = 0; j < n - 1; j++) {
    cout << ans[j] << " ";
  }
  cout << ans[n - 1] << endl;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main(void) {

  int n;
  cin >> n;
  int a[n], ans[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ans[a[i] - 1] = i + 1;
  }

  for (int j = 0; j < n - 1; j++) {
    cout << ans[j] << " ";
  }
  cout << ans[n - 1] << endl;

  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[j] == i) {
        cout << j + 1 << " ";
        break;
      }
    }
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int a1[n];
  for (int i = 0; i < n; i++) {
    a1[a[i] - 1] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cout << a1[i] << " ";
  }
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> ans(n);
  rep(i, n) { cin >> a[i]; }
  rep(i, n) {
    rep(j, n) {
      if (a[j] == i + 1) {
        ans[i] = j + 1;
      }
    }
  }
  rep(i, n) { cout << ans[i] << " "; }
  cout << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> ans(n);
  rep(i, n) { cin >> a[i]; }
  rep(i, n) { ans[a[i] - 1] = i + 1; }
  rep(i, n) { cout << ans[i] << " "; }
  cout << endl;
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;

  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }

  vector<int> order(n);
  for (int i = 1; i <= n; i++) {
    order[a[i]] = i;
  }

  for (int i = 1; i <= n; i++) {
    cout << order[i] << " ";
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;

  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }

  vector<int> order(n + 1);
  for (int i = 1; i <= n; i++) {
    order[a[i]] = i;
  }

  for (int i = 1; i <= n; i++) {
    cout << order[i] << " ";
  }
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  vector<int> V(N);
  for (int i = 0; i < N; ++i) {
    cin >> vec.at(i);
  }
  for (int j = 0; j < N; ++j) {
    int a = vec.at(j);
    V.at(a) = j;
  }
  for (int k = 0; k < N; ++k) {
    cout << V.at(k) << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  vector<int> V(N);
  for (int i = 0; i < N; ++i) {
    cin >> vec.at(i);
  }
  for (int j = 0; j < N; ++j) {
    int a = vec.at(j) - 1;
    V.at(a) = j + 1;
  }
  for (int k = 0; k < N; ++k) {
    cout << V.at(k) << endl;
  }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace ::std;
int main() {
  int n, k, i, j;
  cin >> n;
  int h[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> j;
    h[j] = i;
  }
  for (i = 1; i <= n; i++) {
    cout << h[i] + " ";
  }
}

Fixed submission:
#include <iostream>
using namespace ::std;
int main() {
  int n, k, i, j;
  cin >> n;
  int h[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> j;
    h[j] = i;
  }
  for (i = 1; i <= n; i++) {
    cout << h[i];
    cout << " ";
  }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  int n, tmp;
  int id[10000];
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> tmp;
    id[tmp - 1] = i;
  }
  for (int i = 0; i < n; ++i) {
    cout << id[i] << " ";
  }
  cout << "\n";
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int n, tmp;
  int id[100000];
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> tmp;
    id[tmp - 1] = i;
  }
  for (int i = 0; i < n; ++i) {
    cout << id[i] << " ";
  }
  cout << "\n";
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
  int n;
  cin >> n;
  int o[n];
  rep(i, n) cin >> o[i];
  rep(i, n) {
    rep(j, n) {
      if (o[j] == i + 1) {
        cout << j + 1 << " ";
      }
    }
  }
}

Fixed submission:
#include <iostream>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  rep(i, n) cin >> a[i];
  int ans[n];
  // rep(i,n){
  //     rep(j,n){
  //         if(a[j] == i + 1){
  //             ans[j] << j + 1;
  //         }
  //     }
  // }
  rep(i, n) ans[a[i] - 1] = i + 1;
  rep(i, n) cout << ans[i] << " ";
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

void solve() {
  int n;
  cin >> n;
  vector<int> a;
  int l;
  rep(i, n) {
    cin >> l;
    a.push_back(l);
  }
  rep(i, n) {
    rep(j, n) {
      if (i + 1 == a[j]) {
        cout << j + 1 << " ";
      }
    }
  }
}

int main() {
  solve();
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  vector<int> ans(n);
  rep(j, n) ans[a[j] - 1] = j + 1;
  rep(k, n) cout << ans[k] << " ";
}

int main() {
  solve();
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>

uint64_t getZ() {
  uint64_t v = 0;
  int c;
  while ((c = getchar_unlocked()) >= '0')
    v = v * 10 + c - '0';
  return v;
}

template <int BUFSIZE> struct ans_buf {
  char buf[BUFSIZE];
  int i;
  ans_buf() : i(0) {}
  void putZ(uint64_t v, char delim = '\n') {
    uint64_t k = 1;
    while (k <= v / 10)
      k *= 10;
    for (; k > 0; v %= k, k /= 10)
      buf[i++] = (v / k) + '0';
    buf[i++] = delim;
  }
  void out() { std::fwrite(buf, 1, i, stdout); }
};

int const MAXN = 1e5;
int const MAXA = 2.2e5;
int B[MAXN];

int main() {
  int N = getZ();
  for (int i = 0; i < N; ++i)
    B[getZ() - 1] = i + 1;
  ans_buf<MAXA> buf;
  for (int i = 0; i < N - 1; ++i)
    buf.putZ(B[i], ' ');
  buf.putZ(B[N - 1]);
  buf.out();
  return 0;
}


Fixed submission:
#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>

uint64_t getZ() {
  uint64_t v = 0;
  int c;
  while ((c = getchar_unlocked()) >= '0')
    v = v * 10 + c - '0';
  return v;
}

template <int BUFSIZE> struct ans_buf {
  char buf[BUFSIZE];
  int i;
  ans_buf() : i(0) {}
  void putZ(uint64_t v, char delim = '\n') {
    uint64_t k = 1;
    while (k <= v / 10)
      k *= 10;
    for (; k > 0; v %= k, k /= 10)
      buf[i++] = (v / k) + '0';
    buf[i++] = delim;
  }
  void out() { std::fwrite(buf, 1, i, stdout); }
};

int const MAXN = 1e5;
int const MAXA = 6.8e5;
int B[MAXN];

int main() {
  int N = getZ();
  for (int i = 0; i < N; ++i)
    B[getZ() - 1] = i + 1;
  ans_buf<MAXA> buf;
  for (int i = 0; i < N - 1; ++i)
    buf.putZ(B[i], ' ');
  buf.putZ(B[N - 1]);
  buf.out();
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int a[10010];
int main() {
  int n;
  while (cin >> n) {
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      a[x] = i;
    }
    for (int i = 1; i <= n; i++) {
      cout << a[i];
      if (i == n)
        cout << endl;
      else
        cout << " ";
    }
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int a[100100];
int main() {
  int n;
  while (cin >> n) {
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      a[x] = i;
    }
    for (int i = 1; i <= n; i++) {
      cout << a[i];
      if (i == n)
        cout << endl;
      else
        cout << " ";
    }
  }
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <iostream>
#include <string.h>
using namespace std;

int main() {
  int list[10001] = {0};
  int N = 0;
  int temp = 0;
  cin >> N;

  for (int i = 0; i < N; i++) {
    cin >> temp;
    list[temp - 1] = i;
  } // for

  for (int i = 0; i < N; i++) {
    cout << list[i] + 1 << " ";
  } // for

} // main()

Fixed submission:
#include <bits/stdc++.h>
#include <iostream>
#include <string.h>
using namespace std;

int main() {
  int list[100001] = {0};
  int N = 0;
  int temp = 0;
  cin >> N;

  for (int i = 0; i < N; i++) {
    cin >> temp;
    list[temp - 1] = i;
  } // for

  for (int i = 0; i < N; i++) {
    cout << list[i] + 1 << " ";
  } // for

} // main()
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int N;
  int A[100000];
  int B[100000];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  for (int j = 0; j < N; j++) {
    for (int k = 0; k < N; k++) {
      if (A[k] == j + 1) {
        B[j] = k + 1;
      }
    }
  }

  for (int a = 0; a < N; a++) {
    cout << B[a];
    cout << " ";
  }

  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int N;
  int A[100000];
  int B[100000];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  for (int j = 0; j < N; j++) {
    int x = A[j];
    B[x - 1] = j + 1;
  }

  for (int a = 0; a < N; a++) {
    cout << B[a];
    cout << " ";
  }

  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int n, a[10005], b[10005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[a[i]] = i;
  }
  for (int i = 1; i <= n - 1; i++) {
    cout << b[i] << " ";
  }
  cout << b[n];
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int n, a[100005], b[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[a[i]] = i;
  }
  for (int i = 1; i <= n - 1; i++) {
    cout << b[i] << " ";
  }
  cout << b[n];
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main(void) {
  int n;
  int a[n];
  int b[n];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    b[a[i] - 1] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cout << b[i] << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main(void) {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++)
    cin >> A[i];

  vector<int> rev(N);
  for (int i = 0; i < N; i++)
    rev[A[i] - 1] = i + 1;
  for (int i = 0; i < N; i++)
    cout << rev[i] << endl;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N + 1);
  vector<int> B(N + 1);
  for (int i = 1; i < N + 1; i++) {
    cin >> A.at(i);
  }
  for (int i = 1; i < N + 1; i++) {
    for (int j = 1; j < N + 1; j++) {
      if (A.at(j) == i) {
        B.at(i) = j;
        break;
      }
    }
  }
  for (int i = 1; i < N + 1; i++) {
    cout << B.at(i) << " ";
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N + 1);
  vector<int> B(N + 1);
  for (int i = 1; i < N + 1; i++) {
    cin >> A.at(i);
  }
  for (int i = 1; i < N + 1; i++) {
    B.at(A.at(i)) = i;
  }
  for (int i = 1; i < N + 1; i++) {
    cout << B.at(i) << " ";
  }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    b.at(a.at(i)) = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cout << b.at(i);
    if (i == n - 1) {
      cout << endl;
    } else {
      cout << ' ';
    }
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    b.at(a.at(i) - 1) = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cout << b.at(i);
    if (i == n - 1) {
      cout << endl;
    } else {
      cout << ' ';
    }
  }
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
using vec = vector<int>;
using intk = int64_t;

int main() {
  int N;
  cin >> N;
  vec A(N);
  for (int i = 0; i < N; i++)
    cin >> A[i];
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < N; j++) {
      if (i == A[j]) {
        if (i != N)
          cout << j + 1 << " ";
        else
          cout << j + 1 << endl;
      }
    }
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
using vec = vector<int>;
using intk = int64_t;

int main() {
  int N;
  cin >> N;
  vector<pair<int, int>> A(N);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A[i] = make_pair(a, i + 1);
  }
  sort(A.begin(), A.end());
  for (int i = 0; i < N; i++) {
    cout << A[i].second;
    if (i != N - 1)
      cout << " ";
    else
      cout << endl;
  }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

int main() {
  int N;
  int ans_order[10010];
  int A;

  cin >> N;

  for (int i = 1; i <= N; i++) {
    cin >> A;
    ans_order[A - 1] = i;
  }

  for (int idx = 0; idx < N; idx++) {
    cout << ans_order[idx];

    if (idx == N - 1) {
      cout << endl;
    } else {
      cout << " ";
    }
  }
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

int main() {
  int N;
  int ans_order[100010];
  int A;

  cin >> N;

  for (int i = 1; i <= N; i++) {
    cin >> A;
    ans_order[A - 1] = i;
  }

  for (int idx = 0; idx < N; idx++) {
    cout << ans_order[idx];

    if (idx == N - 1) {
      cout << endl;
    } else {
      cout << " ";
    }
  }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
inline ll read() {
  ll res = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    res = (res << 3) + (res << 1) + ch - '0';
    ch = getchar();
  }
  return res * f;
}
void write(ll x) {
  if (x < 0)
    putchar('-'), x = -x;
  if (x > 9)
    write(x / 10);
  putchar(x % 10 | '0');
}
struct Node {
  int id, j;
} e[10000];
bool cmp(Node a, Node b) { return a.id < b.id; }
signed main() {
  int n = read();
  for (int i = 1; i <= n; i++)
    e[i].id = read(), e[i].j = i;
  sort(e + 1, e + 1 + n, cmp);
  for (int i = 1; i <= n; i++)
    cout << e[i].j << " ";
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
inline ll read() {
  ll res = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    res = (res << 3) + (res << 1) + ch - '0';
    ch = getchar();
  }
  return res * f;
}
void write(ll x) {
  if (x < 0)
    putchar('-'), x = -x;
  if (x > 9)
    write(x / 10);
  putchar(x % 10 | '0');
}
struct Node {
  int id, j;
} e[100003];
bool cmp(Node a, Node b) { return a.id < b.id; }
signed main() {
  int n = read();
  for (int i = 1; i <= n; i++)
    e[i].id = read(), e[i].j = i;
  sort(e + 1, e + 1 + n, cmp);
  for (int i = 1; i <= n; i++)
    cout << e[i].j << " ";
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define _GLIBCXX_DEBUG
using namespace std;
const long long INF = 1LL << 60;
typedef long long ll;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<int> B(N);
  for (int i = 0; i < N; i++) {
    for (int j = 1; j <= N; j++) {
      if (A[i] == j) {
        B[j - 1] = i;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    if (i < N - 1) {
      cout << B[i] + 1 << " ";
    } else {
      cout << B[i] + 1 << endl;
    }
  }
}

Fixed submission:
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define _GLIBCXX_DEBUG
using namespace std;
const long long INF = 1LL << 60;
typedef long long ll;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<int> B(N);
  for (int i = 0; i < N; i++) {
    B[A[i] - 1] = i;
  }
  for (int i = 0; i < N; i++) {
    if (i < N - 1) {
      cout << B[i] + 1 << " ";
    } else {
      cout << B[i] + 1 << endl;
    }
  }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<vector<int>> A(N, vector<int>(N));
  for (int i = 0; i < N; ++i) {
    cin >> A.at(i).at(0);
    A.at(i).at(1) = i + 1;
  }
  sort(A.begin(), A.end());
  for (int i = 0; i < N; ++i) {
    cout << A.at(i).at(1) << " ";
  }
  cout << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<vector<int>> A(N, vector<int>(2));
  for (int i = 0; i < N; ++i) {
    cin >> A.at(i).at(0);
    A.at(i).at(1) = i + 1;
  }
  sort(A.begin(), A.end());
  for (int i = 0; i < N; ++i) {
    cout << A.at(i).at(1) << " ";
  }
  cout << endl;
  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < N; j++) {
      if (A.at(j) == i) {
        cout << j + 1 << endl;
      }
    }
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  vector<int> B(N);
  for (int i = 0; i < N; i++) {
    B.at(A.at(i) - 1) = i + 1;
  }
  for (int i = 0; i < N; i++) {
    cout << B.at(i) << endl;
  }
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
using namespace std;

int qai[10100], n, t;

int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    qai[t] = i + 1;
  }

  for (int j = 1; j <= n; j++)
    cout << qai[j] << " ";
  cout << endl;

  return 0;
}


Fixed submission:
#include <algorithm>
#include <iostream>
using namespace std;

int qai[101000], n, t;

int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    qai[t] = i + 1;
  }

  for (int j = 1; j <= n; j++)
    cout << qai[j] << " ";
  cout << endl;

  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;

  vector<int> answer(n);

  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    answer[m] = i;
  }

  for (int i : answer) {
    cout << i << endl;
  }

  return 0;
}


Fixed submission:
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;

  vector<int> answer(n);

  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    answer[m - 1] = i + 1;
  }

  for (int i : answer) {
    cout << i << endl;
  }

  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n, 0);
  for (int i = 0, a; i < n; i++) {
    cin >> a;
    v[a] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cout << v[i] << ' ';
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n, 0);
  for (int i = 0, a; i < n; i++) {
    cin >> a;
    v[a - 1] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cout << v[i] << ' ';
  }
}
Problem p02899 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    cin >> a.at(i);

  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < n; j++) {
      if (a.at(j) == i)
        cout << j + 1 << " ";
    }
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    cin >> a.at(i);

  vector<int> b(n);

  for (int i = 0; i < n; i++)
    b.at(a.at(i) - 1) = i + 1;

  for (int i = 0; i < n; i++)
    cout << b.at(i) << " ";
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numeric>
#include <queue>
#include <string>
using namespace std;
#define INF 1000000007
#define ll long long
#define rep(i_, start, end) for (ll i_ = (ll)start; i_ < (ll)end; i_++)
#define print(a) cout << a << endl;
#define printarray(a, len) rep(ii, 0, len) cout << a[ii] << " ";
#define printarray2(aa, len)                                                   \
  rep(ij, 0, len) printarray(aa[ij], aa[ij].size());                           \
  print("");

int main() {
  ll n, input;
  cin >> n;
  ll a[10001];
  rep(i, 1, n + 1) {
    cin >> input;
    a[input] = i;
  }
  rep(i, 1, n + 1) { cout << a[i] << " "; }

  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numeric>
#include <queue>
#include <string>
using namespace std;
#define INF 1000000007
#define ll long long
#define rep(i_, start, end) for (ll i_ = (ll)start; i_ < (ll)end; i_++)
#define print(a) cout << a << endl;
#define printarray(a, len) rep(ii, 0, len) cout << a[ii] << " ";
#define printarray2(aa, len)                                                   \
  rep(ij, 0, len) printarray(aa[ij], aa[ij].size());                           \
  print("");

int main() {
  ll n, input;
  cin >> n;
  ll a[100010];
  rep(i, 1, n + 1) {
    cin >> input;
    a[input] = i;
  }
  rep(i, 1, n + 1) { cout << a[i] << " "; }

  return 0;
}
Problem p02899 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main() {
  int N;
  int array[10000] = {};
  vector<pair<int, int>> vect;

  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> array[i];
  }

  for (int i = 0; i < N; i++) {
    vect.push_back(std::make_pair(array[i], i + 1));
  }

  sort(vect.begin(), vect.end());

  for (auto elem = vect.begin(); elem != vect.end(); ++elem) {
    cout << elem->second << ' ';
  }
  cout << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main() {
  int N;
  int array[100000] = {};
  vector<pair<int, int>> vect;

  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> array[i];
  }

  for (int i = 0; i < N; i++) {
    vect.push_back(std::make_pair(array[i], i + 1));
  }

  sort(vect.begin(), vect.end());

  for (auto elem = vect.begin(); elem != vect.end(); ++elem) {
    cout << elem->second << ' ';
  }
  cout << endl;

  return 0;
}