criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
#include<vector>
#include<utility>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<pair<int,int> > jun(n);
    for(int i = 0;i < n;i++){
        int j;
        cin >> j;
        jun.at(i) = make_pair(j,i + 1);
    }

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

    for(int i = 0;i < n;i++){
        int a,b;
        tie(a,b) = jun.at(i);
        cout << b << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |     sort(jun.begin(),jun.end());
      |     ^~~~
      |     short
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;

using ll = long long;

using P = pair<int,int>;


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

vector<int> B(n) ;
rep(i,n) B[A[i]-1] =i+1 ;


rep(i,n)
cout << B[i]  <<endl ;
  return 0;

}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: 'init' was not declared in this scope; did you mean 'int'?
   14 | init n;
      | ^~~~
      | int
a.cc:15:6: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 | cin>>n ;
      |      ^
      |      yn
Language: C

#include<stdio.h>
int main()
{
    int n,i,p,q;
    scanf("%d",&n);
    int A[n];
    for(i=0;i<n;i++){
        scanf("%d",&p);
        A[p-1]=i+1;
    }
    for(i=0;i<n;i++){
        printf("%d\n",A[i]);
    }
    retirn 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:5: error: 'retirn' undeclared (first use in this function)
   14 |     retirn 0;
      |     ^~~~~~
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:11: error: expected ';' before numeric constant
   14 |     retirn 0;
      |           ^~
      |           ;
Language: C

#include<stdio.h>
int main()
{
    int n,i,p,q;
    scanf("%d",&n);
    int A[n];
    for(i=0;i<n;i++){
        scanf("%d",&p);
        A[p-1]=i;
    }
    for(i=0;i<n;i++){
        printf("%d\n",A[i]);
    }
    retirn 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:5: error: 'retirn' undeclared (first use in this function)
   14 |     retirn 0;
      |     ^~~~~~
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:11: error: expected ';' before numeric constant
   14 |     retirn 0;
      |           ^~
      |           ;
Language: C

#include <stdio.h>

int main()
{
  int N;
  scanf("%d",&N);
  int A[N];
  int a;
  int i;
  i = 0;
  while (i < N)
  {
    scanf("%d", &a);
    A[a] = i + 1;
    i++;
  }
  i = 0;
  while (i < N)
  {
    printf("%d",A[i]);
    i++;
  }

Compiler output:
main.c: In function 'main':
main.c:22:3: error: expected declaration or statement at end of input
   22 |   }
      |   ^
Language: C

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

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;
  return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#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[i];
  
  for (int i=0;i<n;i++){
    sort(a.begin(),a.end());
  }
  cout << i << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'i' was not declared in this scope
   13 |   cout << i << endl;
      |           ^
Language: C++

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

int main(){
  int n;
  vector<int> a(n);
  for (int i=0;i<n;i++) cin >> a[i];
  
  for (int i=0;i<n;i++){
    sort(a.begin(),a.end());
  }
  cout << i << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'i' was not declared in this scope
   12 |   cout << i << endl;
      |           ^
Language: C++

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

int main(){
  vector<int> a(n);
  for (int i=0;i<n;i++) cin >> a[i];
  
  sort(a.begin(),a.end());
  for (int i=0;i<n;i++){
    cout << i << endl;
    return 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'n' was not declared in this scope
    5 |   vector<int> a(n);
      |                 ^
Language: C++

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

int main(){
  vector<int> a(n);
  for (int i=0;i<n;i++) cin >> a[i];
  
  sort(a.begin(),a.end());
  cout << i << end;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'n' was not declared in this scope
    5 |   vector<int> a(n);
      |                 ^
a.cc:9:11: error: 'i' was not declared in this scope
    9 |   cout << i << end;
      |           ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
typedef long long ll;
using namespace std;
int main(){
    int n;
    cin>>n;
    map<int, int> a;
    int hoge;
    rep(i,0,n-1){
        cin>>hoge;
        a[hoge] = i+1;
    }
    rep(i,1,n){
        cout<<a[i]<<<<" ";
    }
    cout<<"\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: expected primary-expression before '<<' token
   21 |         cout<<a[i]<<<<" ";
      |                     ^~
Language: C++

//main関数

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

//配列のi番目の要素がj番目に小さいとき、j番目の数がiであるベクトルを返す関数
//配列の要素が全て異なるときにしか正常に動作しない
//例えば{2,4,1,6,0,3,8,9,5}を入れると
//{4,2,0,5,1,8,3,6,7}を返す
vector<int> rank(vector<int> v) {
    int n=v.size();
    map<int,int> m;
    for(int i=0;i<n;i++){
        m[v.at(i)]=i;
    }
    vector<int> w(n);
    for(auto p:m){
        w.at(i)=p.second;
    }
    return w;
}

//配列圧縮
//同率は同じ順位とし、順位は必ず1つずつ上がる
//たとえば{1,6,5,5,0,7,7,79,1}を入れると
//{1,3,2,2,0,4,4,5,1}を返す
vector<int> 圧縮(vector<int> v){
    int n=v.size();
    vector<int> w(n);
    set<int> a;
    for(int i=0;i<n;i++){
        a.insert(v.at(i));
    }
    for()
    return w;
}

Compiler output:
a.cc: In function 'std::vector<int> rank(std::vector<int>)':
a.cc:18:14: error: 'i' was not declared in this scope
   18 |         w.at(i)=p.second;
      |              ^
a.cc: In function 'std::vector<int> \U00005727\U00007e2e(std::vector<int>)':
a.cc:34:9: error: expected primary-expression before ')' token
   34 |     for()
      |         ^
a.cc:36:1: error: expected primary-expression before '}' token
   36 | }
      | ^
a.cc:35:14: error: expected ';' before '}' token
   35 |     return w;
      |              ^
      |              ;
   36 | }
      | ~             
a.cc:36:1: error: expected primary-expression before '}' token
   36 | }
      | ^
a.cc:35:14: error: expected ')' before '}' token
   35 |     return w;
      |              ^
      |              )
   36 | }
      | ~             
a.cc:34:8: note: to match this '('
   34 |     for()
      |        ^
a.cc:36:1: error: expected primary-expression before '}' token
   36 | }
      | ^
a.cc:36:1: warning: no return statement in function returning non-void [-Wreturn-type]
Language: C++

//main関数

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

vector<int> rank(vector<int> v) {
    int n=v.size();
    map<int,int> m;
    for(int i=0;i<n;i++){
        m[v.at(i)]=i;
    }
    vector<int> w(n);
    for(auto p:m){
        w.at(i)=p.second;
    }
    return w;
}

int main(){
    int n;
    cin>>n;
    vector<int>a(n);
    for(auto &p:a) cin>>p;
    a=rank(a);
    for(auto &p:a){
        cout<<p<<" ";
    }
}

Compiler output:
a.cc: In function 'std::vector<int> rank(std::vector<int>)':
a.cc:14:14: error: 'i' was not declared in this scope
   14 |         w.at(i)=p.second;
      |              ^
a.cc: In function 'int main()':
a.cc:24:7: error: reference to 'rank' is ambiguous
   24 |     a=rank(a);
      |       ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:3:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:6:13: note:                 'std::vector<int> rank(std::vector<int>)'
    6 | vector<int> rank(vector<int> v) {
      |             ^~~~
Language: C++

N=int(input())
A=list(map(int,input().split()))
b=sorted(A)
c=[0]*N
for i in range(N):
  c[A[i]-1]=b[i]
print(c)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int N;
    vector<int> A(1000001)
    vector<int> B(1000001);
    cin >> N ;
    for(int i=0;i<N;i++){
        cin >> A.at(i);
    }
    for(int i=0;i<N;i++){
        B.at(A.at(i)-1)=i+1;
    }
    for(int i=0;i<N;i++){
        if(i==N-1){
            
            cout <<B.at(i)<<endl;
            return 0;
        }
        cout<<B.at(i)<<" ";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'vector'
    6 |     vector<int> B(1000001);
      |     ^~~~~~
a.cc:12:9: error: 'B' was not declared in this scope
   12 |         B.at(A.at(i)-1)=i+1;
      |         ^
a.cc:17:20: error: 'B' was not declared in this scope
   17 |             cout <<B.at(i)<<endl;
      |                    ^
a.cc:20:15: error: 'B' was not declared in this scope
   20 |         cout<<B.at(i)<<" ";
      |               ^
Language: C++

#include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
    ll 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;
}

 


Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'A' was not declared in this scope
   21 |         rev[A[i]-1]=i+1;
      |             ^
Language: C++

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i =0; i < n ;i++)


int main()
{
    vector<pair<int, int>> v;
    int N;
    cin >> N;
     
    int temp; 

    rep(i, N){
        cin >> temp;
        pair<int, int> ptemp(temp, i+1);
        v.push_back(ptemp);
    }
    
    sort(v.begin(), v.end());
    rep(i, N) cout << v[i].second << ' ';
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<pair<int, int>> v;
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:8:12: error: 'pair' was not declared in this scope
    8 |     vector<pair<int, int>> v;
      |            ^~~~
a.cc:1:1: note: 'std::pair' is defined in header '<utility>'; this is probably fixable by adding '#include <utility>'
  +++ |+#include <utility>
    1 | using namespace std;
a.cc:8:17: error: expected primary-expression before 'int'
    8 |     vector<pair<int, int>> v;
      |                 ^~~
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> N;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:16:14: error: expected primary-expression before 'int'
   16 |         pair<int, int> ptemp(temp, i+1);
      |              ^~~
a.cc:17:9: error: 'v' was not declared in this scope
   17 |         v.push_back(ptemp);
      |         ^
a.cc:17:21: error: 'ptemp' was not declared in this scope; did you mean 'temp'?
   17 |         v.push_back(ptemp);
      |                     ^~~~~
      |                     temp
a.cc:20:10: error: 'v' was not declared in this scope
   20 |     sort(v.begin(), v.end());
      |          ^
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   20 |     sort(v.begin(), v.end());
      |     ^~~~
      |     short
a.cc:21:15: error: 'cout' was not declared in this scope
   21 |     rep(i, N) cout << v[i].second << ' ';
      |               ^~~~
a.cc:21:15: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout << endl;
      |     ^~~~
a.cc:22:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:13: error: 'endl' was not declared in this scope
   22 |     cout << endl;
      |             ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C

#include<stdio.h>
#include<string.h>
int main ()
{
    int n,i,a[100000];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }

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

    getch();
    return 0;

}



Compiler output:
main.c: In function 'main':
main.c:17:5: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
   17 |     getch();
      |     ^~~~~
      |     getc
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long; // ll は long long　と同じとする。
int main () {
    ll N;
    cin >> N;
    vector <int> A(N);
    for(int i = 0; i < N; i++){
        cin >> A.at(i);
    }
    vector<int> rev(N);
    for(int i = 0; i < N; i++){
        count[A[i] - 1] = i + 1;
    }
    for(int i = 0; i < N; i++){
        cout << count[i] << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   13 |         count[A[i] - 1] = i + 1;
      |              ^
a.cc:16:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   16 |         cout << count[i] << endl;
      |                      ^
Language: C

#include<stdio.h>
int main ()
{
    int n,i,a[100000],b[100000];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }

    for(i=0;i<n;i++)
    {
        b[i]=a[i];
    }
    for(i=0;i<n;i++)
    {
        printf("%d ",b[i]);
    }
    getch();

}

Compiler output:
main.c: In function 'main':
main.c:19:5: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
   19 |     getch();
      |     ^~~~~
      |     getc
Language: C

#include<stdio.h>
int main(void){
  int n;
  scanf("%d",&n);
  int a[n],b[n];
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    b[a[i]]=i+1; 
  }
 for(i=0;i<n;i++){
  printf("%d",b[i]);
 }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i=0;i<n;i++){
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<bits/stdc++.h>
using namespace std;
main()
{
    int n,a[100009],b[100009],i,j,k,l;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        b[i]=a[i];
    }
    sort(b,b+n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if(b[i]==a[j])
            {
                printf("%d ",j+1);
                continue;
            }
        }
    }
    printf("\n");
    return 0;
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<map>
using namespace std;

int main(){
    int n;cin>>n;
    map<int,int> A;
    for(int i=1;i<=n;i++){
        int a;cin>>a;
        A[a]=i;
    }
    for(auto& itr:A){
        cout<<itr->second<<((i!=n)' ':'\n');
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: base operand of '->' has non-pointer type 'std::pair<const int, int>'
   14 |         cout<<itr->second<<((i!=n)' ':'\n');
      |                  ^~
a.cc:14:30: error: 'i' was not declared in this scope
   14 |         cout<<itr->second<<((i!=n)' ':'\n');
      |                              ^
a.cc:14:35: error: expected ')' before '\x20'
   14 |         cout<<itr->second<<((i!=n)' ':'\n');
      |                            ~      ^~~
      |                                   )
Language: Java

public class Main{
    public static void main(String[] args) throws Exception {
        Scanner sc =new Scanner(System.in);
        int N=sc.nextInt();
        int[] A =new int[N];
        for(int i=0;i<N;i++){
            A[i] = sc.nextInt();
        }
        sc.close();

        int k = 1;

        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++){
                // 出席番号kを探す
                if(A[j]==k){
                    System.out.println(j+1);
                }
            }
            k=k+1;
        }


    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc =new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc =new Scanner(System.in);
                        ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (int i=0; i<n; i++) {
    a[i].second = i+1;
    cin >> a[i].first;
  }
  sort(a.begin, a.end());
  for (int i=0; i<n; i++) {
    cout << a[i].second << " ";
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: no matching function for call to 'sort(<unresolved overloaded function type>, std::vector<std::pair<int, int> >::iterator)'
   12 |   sort(a.begin, a.end());
      |   ~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<pair<int, int>*, vector<pair<int, int> > >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:32: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int>a(n);
    vector<int>moto(n);
    for(int i=1;i<=n;i++) cin >> a[i];
    for(int i=1;i<=n;i++){
        moto[a[i]]=i
    }
     for(int i=1;i<=n;i++){
         cout << moto[i] << " ";
     }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: expected ';' before '}' token
   10 |         moto[a[i]]=i
      |                     ^
      |                     ;
   11 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,a;cin >> n;
    vector <pair<int, int>> v;
    for(int i =1; i <= N; i++){
        cin >> a;
        v.push_back(make_pair(a, i));
    }
    sort(v.begin(), v.end());
    for(int i =0; i < N; i++)
        cout << v.at(i).second << " ";
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: 'N' was not declared in this scope
    6 |     for(int i =1; i <= N; i++){
      |                        ^
a.cc:11:23: error: 'N' was not declared in this scope
   11 |     for(int i =0; i < N; i++)
      |                       ^
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int  n = sc.nextInt();
    int[] order = new int[n];
    String out = "";
    for(int i = 0; i < n; i++){
      order[sc.nextInt()] = i + 1;
      out += "" + order[i] + " ";
    } 
    System.out.pritnln(out);
  }
}

Compiler output:
Main.java:12: error: cannot find symbol
    System.out.pritnln(out);
              ^
  symbol:   method pritnln(String)
  location: variable out of type PrintStream
1 error
Language: Java

N = gets.to_i
A = gets.split(' ').map(&:to_i)
B = []
(1..N).each{|i| B << [i, A[i-1]]}
B.sort!{|a,b| a[1] - b[1]}
puts B.map{|o|o[0]}.join ' '



Compiler output:
Main.java:1: error: class, interface, enum, or record expected
N = gets.to_i
^
1 error
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		
		for (int i=1; i<=N; i++) {
			a[sc.nextInt()-1] = i;
		}
		for (int a : A) {
			System.out.println(a + " ");
		}
	}
}

Compiler output:
Main.java:10: error: cannot find symbol
			a[sc.nextInt()-1] = i;
			^
  symbol:   variable a
  location: class Main
1 error
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		
		for (int i=0; i<N; i++) {
			a[sc.nextInt()-1] = i;
		}
		for (a : A) {
			System.out.println(a + " ");
		}
	}
}

Compiler output:
Main.java:12: error: bad initializer for for-loop
		for (a : A) {
		     ^
1 error
Language: C++

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

int main(){
  int N;
  cin >> N;
  map<int> A;
  for(int ii=0; ii<N; ii++){
    int a;
    cin >> a;
    A[a]=ii;
  }
  for(auto& a : A){
    cout << a.second << " ";
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: wrong number of template arguments (1, should be at least 2)
    7 |   map<int> A;
      |          ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:11:6: error: invalid types 'int[int]' for array subscript
   11 |     A[a]=ii;
      |      ^
a.cc:13:17: error: 'begin' was not declared in this scope
   13 |   for(auto& a : A){
      |                 ^
a.cc:13:17: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:13:17: error: 'end' was not declared in this scope
   13 |   for(auto& a : A){
      |                 ^
a.cc:13:17: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ‘ ‘
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a;
  vector<ll> s(n);
  rep(i, n){
    cin >> a;
    a--;
    s[a] = i;
  }
  rep(i, n){
    cout << s[i];
    hina;
  }
  memi;
}

Compiler output:
a.cc:10:22: error: extended character ‘ is not valid in an identifier
   10 | #define hina cout << ‘ ‘
      |                      ^
a.cc:10:24: error: extended character ‘ is not valid in an identifier
   10 | #define hina cout << ‘ ‘
      |                        ^
a.cc: In function 'int main()':
a.cc:10:22: error: '\U00002018' was not declared in this scope
   10 | #define hina cout << ‘ ‘
      |                      ^
a.cc:23:5: note: in expansion of macro 'hina'
   23 |     hina;
      |     ^~~~
Language: Java

import java.util.*;
public class problem
{
  public static void main()
{
        Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arr [] = new int [n];
		for(int i=0; i<arr.length; i++) {
			arr [i] = sc.nextInt();
		}
		int ans [] = new int [n];
		for(int i=0; i<arr.length; i++) {
			ans[arr[i]-1] = i+1;
			
		}
		for(int i=0; i<ans.length; i++) {
			System.out.print(ans[i]+" ");
		}
  }
}


Compiler output:
Main.java:2: error: class problem is public, should be declared in a file named problem.java
public class problem
       ^
1 error
Language: Java

import java.util.*.;
class problem
{
  public static void main()
{
        Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arr [] = new int [n];
		for(int i=0; i<arr.length; i++) {
			arr [i] = sc.nextInt();
		}
		int ans [] = new int [n];
		for(int i=0; i<arr.length; i++) {
			ans[arr[i]-1] = i+1;
			
		}
		for(int i=0; i<ans.length; i++) {
			System.out.print(ans[i]+" ");
		}
  }
}


Compiler output:
Main.java:1: error: ';' expected
import java.util.*.;
                  ^
1 error
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public  class Codechef {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arr [] = new int [n];
		for(int i=0; i<arr.length; i++) {
			arr [i] = sc.nextInt();
		}
		int ans [] = new int [n];
		for(int i=0; i<arr.length; i++) {
			ans[arr[i]-1] = i+1;
			
		}
		for(int i=0; i<ans.length; i++) {
			System.out.print(ans[i]+" ");
		}
	}
}

Compiler output:
Main.java:6: error: class Codechef is public, should be declared in a file named Codechef.java
public  class Codechef {
        ^
1 error
Language: C++

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef {
	public static void main(String[] args) throws Exception {
		InputStreamReader read = new InputStreamReader(System.in);
		BufferedReader in = new BufferedReader(read);
		int N = Integer.parseInt(in.readLine());
		String str = in.readLine();
		String starr[] = str.split(" ");
		int i, j;
		for (i = 1; i <= N; i++) {
			for (j = 0; j < N; j++) {
				if (Integer.parseInt(starr[j]) == i) {
					System.out.print((j + 1) + " ");
				}
			}
		}

	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.lang.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:15: error: expected ':' before 'static'
    7 |         public static void main(String[] args) throws Exception {
      |               ^~~~~~~
      |               :
a.cc:7:33: error: 'String' has not been declared
    7 |         public static void main(String[] args) throws Exception {
      |                                 ^~~~~~
a.cc:7:42: error: expected ',' or '...' before 'args'
    7 |         public static void main(String[] args) throws Exception {
      |                                          ^~~~
a.cc:7:46: error: expected ';' at end of member declaration
    7 |         public static void main(String[] args) throws Exception {
      |                                              ^
      |                                               ;
a.cc:7:48: error: 'throws' does not name a type
    7 |         public static void main(String[] args) throws Exception {
      |                                                ^~~~~~
a.cc:23:2: error: expected ';' after class definition
   23 | }
      |  ^
      |  ;
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStreamReader read=new InputStreamReader(System.in);
		BufferedReader in=new BufferedReader(read);
		int N=Integer.parseInt(in.readLine());
		String str=in.readLine();
		String starr[]=str.split("");
		int i,j;
		for(i=1;i<=N;i++)
		{
		    for(j=0;j<N;j++)
		    {
		        if(Integer.parseInt(starr[j])==i)
		        {
		            System.out.print((j+1)+" ")
		        }
		    }
		}
		
	}
}

Compiler output:
Main.java:22: error: ';' expected
		            System.out.print((j+1)+" ")
		                                       ^
1 error
Language: C++

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStreamReader read=new InputStreamReader(System.in);
		BufferedReader in=new BufferedReader(read);
		int N=Integer.parseInt(in.readLine());
		String str=in.readLine();
		String starr[]=str.split("");
		int i,j;
		for(i=1;i<=N;i++)
		{
		    for(j=0;j<N;j++)
		    {
		        if(Integer.parseInt(starr[j])==i)
		        {
		            System.out.print((j+1)+" ");
		        }
		    }
		}
		
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.lang.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:15: error: expected ':' before 'static'
    8 |         public static void main (String[] args) throws java.lang.Exception
      |               ^~~~~~~
      |               :
a.cc:8:34: error: 'String' has not been declared
    8 |         public static void main (String[] args) throws java.lang.Exception
      |                                  ^~~~~~
a.cc:8:43: error: expected ',' or '...' before 'args'
    8 |         public static void main (String[] args) throws java.lang.Exception
      |                                           ^~~~
a.cc:8:47: error: expected ';' at end of member declaration
    8 |         public static void main (String[] args) throws java.lang.Exception
      |                                               ^
      |                                                ;
a.cc:8:49: error: 'throws' does not name a type
    8 |         public static void main (String[] args) throws java.lang.Exception
      |                                                 ^~~~~~
a.cc:28:2: error: expected ';' after class definition
   28 | }
      |  ^
      |  ;
Language: C++

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef {
	public static void main (String[] args) throws java.lang.Exception {

		InputStreamReader read=new InputStreamReader(System.in);
		BufferedReader in=new BufferedReader(read);

		int N=Integer.parseInt(in.readLine());
		String str=in.readLine();
		String starr[]=str.split(" ");

		int i,j;
		for(i=1;i<=N;i++) {
		    for(j=0;j<N;j++) {
		        if(Integer.parseInt(starr[j])==i) {
		            System.out.print((j+1)+" ");
		        }
		    }
		}
		
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.lang.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:15: error: expected ':' before 'static'
    6 |         public static void main (String[] args) throws java.lang.Exception {
      |               ^~~~~~~
      |               :
a.cc:6:34: error: 'String' has not been declared
    6 |         public static void main (String[] args) throws java.lang.Exception {
      |                                  ^~~~~~
a.cc:6:43: error: expected ',' or '...' before 'args'
    6 |         public static void main (String[] args) throws java.lang.Exception {
      |                                           ^~~~
a.cc:6:47: error: expected ';' at end of member declaration
    6 |         public static void main (String[] args) throws java.lang.Exception {
      |                                               ^
      |                                                ;
a.cc:6:49: error: 'throws' does not name a type
    6 |         public static void main (String[] args) throws java.lang.Exception {
      |                                                 ^~~~~~
a.cc:25:2: error: expected ';' after class definition
   25 | }
      |  ^
      |  ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n;
pair<int,int>p[233333];
int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        int a;scanf("%d",&a);
        p[i]=make_pair(a,i);
    }
    sort(a,a+n);
    for(int i=0;i<n;i++)printf("%d ",a[i].second);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'a' was not declared in this scope
   11 |     sort(a,a+n);
      |          ^
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStreamReader read=new InputStreamReader(System.in);
		BufferedReader in=new BufferedReader(read);
		int N=Integer.parseInt(in.readLine());
		String str=in.readLine();
		String starr[]=str.split(" ");
		int i,j;
		for(i=1;i<=N;i++)
		{
		    for(j=0;j<N;j++)
		    {
		        if(Integer.parseInt(starr[j])==i)
		        {
		            System.out.print((j+1)+" ");
		        }
		    }
		}
		
	}
}


Compiler output:
Main.java:6: error: class Codechef is public, should be declared in a file named Codechef.java
public class Codechef
       ^
1 error
Language: C

#include <bits/stdc++.h>

using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int>> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i).first;
    vec.at(i).second = i;
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < n; i++) {
    cout << vec.at(i).second << '\n';
  }
	return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

void fnInput(vector<int>& rvnOrder)
{
  int nOrderSiz;
  cin >> nOrderSiz;

  rvnOrder.resize(nOrderSiz + 1);
  for (int n = 1; n < rvnOrder.size(); n++)
  {
    int nOrder;
    cin >> nOrder;
    rvnOrder[nOrder] = n;
  }
}

int fnOrderCheck(const vector<int>& cnrvnOrder)
{
  for (int n = 1; n < cnrvnOrder.size(); n++)
    cout << cnrvnOrder[n] << " ";

  cout << endl;
}

int main()
{
  vector<int> vnOrder;

  fnInput(vnOrder);
  fnOrderCheck(vnOrder);

  return 0

Compiler output:
a.cc: In function 'int fnOrderCheck(const std::vector<int>&)':
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
   24 | }
      | ^
a.cc: In function 'int main()':
a.cc:33:11: error: expected ';' at end of input
   33 |   return 0
      |           ^
      |           ;
a.cc:33:11: error: expected '}' at end of input
a.cc:27:1: note: to match this '{'
   27 | {
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <utility>

#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;

using namespace std;

int main()
{
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  rep(i, n)
  {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  sort(a.begin(), a.end(),
      [](pair<int, int> x, pair<int, int> y){return x.first < y.first;});
  for(auto i : a)
    cout << i.second << " ";
  cout << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   20 |   sort(a.begin(), a.end(),
      |   ^~~~
      |   short
Language: C++

#include <vector>
using namespace std;

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> N;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <vector>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << res[i] << endl;
      |         ^~~~
a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:27: error: 'endl' was not declared in this scope
   18 |         cout << res[i] << endl;
      |                           ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <vector>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] record = new int[n];
		for (int i = 0; i < record.length; i++) {
			record[i] = sc.nextInt();
		}
		
		for (int i = 1; i <= n; i++) {
			for (int j = 0; j < record.length; j++) {
				if (record[j] == i) {
					System.out.print(j + 1 + " ");
				}
			}
		}
		System.out.println();
		
	}
}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
 {
int n;
cin>>n;
int a[n];
int b[n];
for(int i=0;i<n;i++)
   {
       cin>>a[i];
   }
   
   for(i=1;i<=n;i++)
     {
         if(a[i-1]==i)
          b[i-1]=i;
          
          else
          b[a[i-1]]=i;
         
    }
    for(int i=0;i<n;i++)
      {
          cout<<b[i];
      }
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'i' was not declared in this scope
   14 |    for(i=1;i<=n;i++)
      |        ^
Language: C

#include<stdio.h>
int main()
    {
        int a[100000]={0},i;
        int n,t;
        scanf("%d",&n);
        for(i=1;i<=n;i++)
        {
            scanf("%d",&num);
            a[num]=i;
        }
        
        for(i=1;i<=n;i++)
        printf("%d ",a[i]);
}

Compiler output:
main.c: In function 'main':
main.c:9:25: error: 'num' undeclared (first use in this function)
    9 |             scanf("%d",&num);
      |                         ^~~
main.c:9:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
    {
        int a[100000]={0},i;
        int n,t;
        scanf("%d",&n);
        for(i=1;i<=n;i++)
        {
            scanf("%d",&t);
            a[t]=i;
        }
        
        for(i=1;i<=n;i++)
        printf("%d ",a[i]);

Compiler output:
main.c: In function 'main':
main.c:14:9: error: expected declaration or statement at end of input
   14 |         printf("%d ",a[i]);
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>

#define ll long long
#define vi vector<int>
#define pi pair<int, int>
  
using namespace std;                           

int n, a[1000000001], b[10000000001];

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

Compiler output:
/tmp/ccopc3eX.o: in function `main':
a.cc:(.text+0x77): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccopc3eX.o
a.cc:(.text+0xa9): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccopc3eX.o
collect2: error: ld returned 1 exit status
Language: C

include<stdio.h>
int main(){
  int N,i,k;
  scanf("%d",&N);
  int A[N],B[N];
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
   }
  for(k=1;k<=N;k++){
    for(i=0;i<N;i++){
      if(k==A[i])printf("%d",i+1);
      }
     }
      return 0;
     }

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include<stdio.h>
int main(){
  int N,i,k;
  scanf("%d",&N);
  int A[N],B[N];
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
   }
  for(k=0;k<N;k++){
    for(i=0;i<N;i++){
      if(k==A[i])B[k]=A[i];
        }
    printf("%d",B[k]);
      {
      return 0;
     }


Compiler output:
main.c: In function 'main':
main.c:16:6: error: expected declaration or statement at end of input
   16 |      }
      |      ^
main.c:16:6: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
int main(){
  int N,i,k;
  scanf("%d",&N);
  int A[N],B[N];
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
   }
  for(k=0;k<N;k++){
    for(i=0;i<N;i++){
      if(k==A[i])B[k]=A[i];
        }
    prinrf("%d",B[k]);
      {
      return 0;
     }


Compiler output:
main.c: In function 'main':
main.c:13:5: error: implicit declaration of function 'prinrf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   13 |     prinrf("%d",B[k]);
      |     ^~~~~~
      |     printf
main.c:16:6: error: expected declaration or statement at end of input
   16 |      }
      |      ^
main.c:16:6: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
int main(){
  int N,i,k;
  scanf("%d",&N);
  int A[N],B[N];
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
   }
  for(k=0;k<N;k++){
    for(i=0;i<N;i++){
      if(k==A[i])B[k]=A[i]
        }
    prinrf("%d",B[k])
      {
      return 0;
     }

Compiler output:
main.c: In function 'main':
main.c:11:27: error: expected ';' before '}' token
   11 |       if(k==A[i])B[k]=A[i]
      |                           ^
      |                           ;
   12 |         }
      |         ~                  
main.c:13:5: error: implicit declaration of function 'prinrf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   13 |     prinrf("%d",B[k])
      |     ^~~~~~
      |     printf
main.c:13:22: error: expected ';' before '{' token
   13 |     prinrf("%d",B[k])
      |                      ^
      |                      ;
   14 |       {
      |       ~               
main.c:16:6: error: expected declaration or statement at end of input
   16 |      }
      |      ^
main.c:16:6: error: expected declaration or statement at end of input
Language: C++

#include <iostream>
#include <map>

using namespace std;

int main() {
    int N;
    cin >> N;
    map<int, int> classroom;
    for (int i=1; i<=N; i++) {
        int n;
        cin >> n;
        classroom[n] = i;
    }
    for (int i=1; i<=N; i++) {
        cout << classroom[i] << ";
    }
}

Compiler output:
a.cc:16:33: warning: missing terminating " character
   16 |         cout << classroom[i] << ";
      |                                 ^
a.cc:16:33: error: missing terminating " character
   16 |         cout << classroom[i] << ";
      |                                 ^~
a.cc: In function 'int main()':
a.cc:17:5: error: expected primary-expression before '}' token
   17 |     }
      |     ^
Language: C++

# include <iostream>
# include <vector>


using namespace std;


int main() {
    int n; cin >> n;
    vector<pair<int, int>> a(n);

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

    sort(a.begin(), a.end());
    for (auto e: a) cout << e.second+1 << ' '; cout << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |     sort(a.begin(), a.end());
      |     ^~~~
      |     short
Language: C++

#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[i];
  }
  
  for(int i=1;i<N+1;i++){
    for(int j=0;j<N;j++){
      if(i==A[j]){
        cout << j+1 << " ";
      }
      if(A[j]==N){
        break;
      }
    }
    if(A[j]==N){
      break;
    }
  }        
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: 'j' was not declared in this scope
   22 |     if(A[j]==N){
      |          ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int n, tmp;
  cin >> n;
  vector<pair<int,int>> v(n);
  for(int i= 0; i < n; i++){
    cin >> v[i].first;
    v[i].second = i +1;
  }
  sort(v.begin(), v.end());
  for(auto &p: v){
    cout << v.second << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   15 |     cout << v.second << endl;
      |               ^~~~~~