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

# include <iostream>
# include <vector>

using namespace std;
typedef pair<int, pair<string, int>> vp;


bool compare_with_restaurant_name(vp left, vp right) {
    return left.second.first < right.second.first;
}

bool compare_with_score(vp left, vp right) {
    return left.second.second > right.second.second;
}


int main() {
    int n; cin >> n;
    string s; int p;

    vector<pair<string, int>> restaurants(n);
    vector<vp> restaurants_with_idxs(n);

    for (int i=0; i<n; ++i) {
        cin >> s >> p;
        restaurants[i] = make_pair(s, p);
        restaurants_with_idxs[i] = make_pair(i+1, restaurants[i]);
    }

    sort(restaurants_with_idxs.begin(), restaurants_with_idxs.end(), compare_with_restaurant_name);

    vector<pair<int, int>> partisions;
    int left  = 0;
    int right = 0;
    string prev_city_name = restaurants_with_idxs[0].second.first;

    for (int i=1; i<n; ++i) {
        if (restaurants_with_idxs[i].second.first == prev_city_name) {
            right++;
        }
        else {
            partisions.push_back(make_pair(left, right));
            left  = i+1;
            right = i+1;
        }
        
        prev_city_name = restaurants_with_idxs[i].second.first;
    }

    if (left != right) {
        partisions.push_back(make_pair(left, right));
    }

    int left_part, right_part;
    int cursor = 0;
    int partision_length = partisions.size();

    for (pair<int, int> partision: partisions) {
        left_part  = partision.first;
        right_part = partision.second;

        if (cursor == 0) right_part++;
        if (cursor != 0)  left_part--;

        sort(restaurants_with_idxs.begin()+left_part,
             restaurants_with_idxs.begin()+right_part,
             compare_with_score);

        cursor++;
    }

    for (vp restaurants_with_idx: restaurants_with_idxs) {
        cout << restaurants_with_idx.first << endl;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |     sort(restaurants_with_idxs.begin(), restaurants_with_idxs.end(), compare_with_restaurant_name);
      |     ^~~~
      |     short
a.cc:74:6: error: expected '}' at end of input
   74 |     }
      |      ^
a.cc:17:12: note: to match this '{'
   17 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <string>
using namespace std;

int main() {
	int N;
	cin >> N;
	
	int a, b;
	string str;
	vector<pair<string, int> > p(N) ;
	for(int i = 0; i < N; ++i) {
		cin >> str >> a;
		b = 101 - a;
		stringstream ss;
		ss << bitset<8>(b);
		str = str + ss.str();
		p[i] = make_pair(str, i + 1); 
	}
	sort(p.begin(), p.end());
	for(int i = 0; i < N; ++i) {
		cout << p[i].second << endl;
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: 'bitset' was not declared in this scope
   20 |                 ss << bitset<8>(b);
      |                       ^~~~~~
a.cc:6:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    5 | #include <sstream>
  +++ |+#include <bitset>
    6 | #include <string>
Language: Java

import java.util.*;
public class arrange {
    public static void main(String[] args) {
      try{
        Scanner Sc = new Scanner(System.in);
        int n = Sc.nextInt();
       // Sc.next();
        String ar[] = new String[n];
        int a[] = new int[n];
        String ar1[]=new String[n];
        int q[]=new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = Sc.next();
            ar1[i]=ar[i];
            a[i] = Sc.nextInt();
            q[i]=a[i];
            //Sc.next();
        }
        for (int i = 0; i < n - 1; i++) {
            for (int j = i+1; j < n; j++) {
                if (ar[i].compareTo(ar[j]) > 0) {
                    String t = ar[j];
                    ar[j] = ar[i];
                    ar[i] = t;
                    int p = a[j];
                    a[j] = a[i];
                    a[i] = p;
                }
            }
        }
        int arr[]=new int[n];
        int y=1;
        arr[0]=0;
        for(int i=0;i<n-1;i++) {
            if (ar[i].compareTo(ar[i + 1]) != 0) {
                arr[y] = i+1;
                y++;
            }
        }
        arr[y]=n;
        for(int i=0;i<y;i++)
        {
            for(int j=arr[i];j<arr[i+1]-1;j++)
            {
                if(a[j]<a[j+1])
                {
                    int k=a[j];
                    a[j]=a[j+1];
                    a[j+1]=k;
                }
            }
        }

        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                if((ar[i].compareTo(ar1[j])==0)&&(a[i]==q[j]))
                {
                    System.out.println(j+1);
                    break;
                }
            }

        }
      }catch(Exception e)
      {
        return;        
        }
    }
}

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

import java.util.*;
public class arrange {
    public static void main(String[] args) {
        Scanner Sc = new Scanner(System.in);
        int n = Sc.nextInt();
       // Sc.next();
        String ar[] = new String[n];
        int a[] = new int[n];
        String ar1[]=new String[n];
        int q[]=new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = Sc.next();
            ar1[i]=ar[i];
            a[i] = Sc.nextInt();
            q[i]=a[i];
            //Sc.next();
        }
        for (int i = 0; i < n - 1; i++) {
            for (int j = i+1; j < n; j++) {
                if (ar[i].compareTo(ar[j]) > 0) {
                    String t = ar[j];
                    ar[j] = ar[i];
                    ar[i] = t;
                    int p = a[j];
                    a[j] = a[i];
                    a[i] = p;
                }
            }
        }
        int arr[]=new int[n];
        int y=1;
        arr[0]=0;
        for(int i=0;i<n-1;i++) {
            if (ar[i].compareTo(ar[i + 1]) != 0) {
                arr[y] = i+1;
                y++;
            }
        }
        arr[y]=n;
        for(int i=0;i<y;i++)
        {
            for(int j=arr[i];j<arr[i+1]-1;j++)
            {
                if(a[j]<a[j+1])
                {
                    int k=a[j];
                    a[j]=a[j+1];
                    a[j+1]=k;
                }
            }
        }

        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                if((ar[i].compareTo(ar1[j])==0)&&(a[i]==q[j]))
                {
                    System.out.println(j+1);
                    break;
                }
            }

        }
        }
    }



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

#include<stdio.h>
#include<string.h>
using namespace std;

int main()
{
  int i,j,N;
  int* m=0;
  cin >> N;
  char* moji[N][30], tmp[30];
  int* num[N];
  for(i=0;i<N;i++){
    scanf("%s",*moji[i]);
    scanf("%d",*num[i]);
  }
  for(i=1;i<N;i++){
    for(j=1;j<N;j++){
      if(strcmp(*moji[j-1],*moji[j])>0){
        strcpy(*tmp,*moji[j-1]);
        for(int h=1;h<N;h++){
          strcpy(*moji[h-1],*moji[h]);
        }
        strcpy(*moji[N-1],*tmp);
      }
      if(strcmp(*moji[j-1],*moji[j])==0){
        if(*num[j-1]<*num[j]){
          *m=*num[j-1];
          *num[j-1]=*num[j];
          *num[j]=*m;
        }
      }
    }
    for(i=0;i<N;i++){
      printf("%s%d\n",*moji[i],*num[i]);
    }
  }
          
      


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> N;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<string.h>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:19:16: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   19 |         strcpy(*tmp,*moji[j-1]);
      |                ^~~~
      |                |
      |                char
In file included from a.cc:2:
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:23:27: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   23 |         strcpy(*moji[N-1],*tmp);
      |                           ^~~~
      |                           |
      |                           char
/usr/include/string.h:141:70: note:   initializing argument 2 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:36:4: error: expected '}' at end of input
   36 |   }
      |    ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#include<string>
using namespace std;
/*
2019/05/26
*/
//sort

int main(){
  int n;
  cin>>n;
  int key[n];
  string name[n];
  int num[n];
  vector<int> ans(0, n);

  int i,j,temp;
  for (i = 0; i < n-1; i++) {
    for (j = n-1; j > i; j--) {
      if (name[j-1].compare(,name[j])>0) {
        swap(name[j-1],name[j]);
        swap(num[j-1],num[j]);
        swap(key[j-1],key[j]);
      }
    }
  }
  for (i = 0; i < n-1; i++) {
    for (j = n-1; j > i; j--) {
      if (num[j-1]>num[j]) {
        swap(num[j-1],num[j]);
        swap(key[j-1],key[j]);
      }
    }
  }

  for(int i=0;i<n;i++)ans[i]=i+1;
  for (i = 0; i < n-1; i++) {
    for (j = n-1; j > i; j--) {
      if (key[j-1]<key[j]) {
        swap(num[j-1],num[j]);
      }
    }
  }
  for(int i:ans)cout<<i<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: expected primary-expression before ',' token
   20 |       if (name[j-1].compare(,name[j])>0) {
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin>>N;
  
  vector<string>S(N);
  vector<int>P(N);
  
  for(int i=0;i<N;i++){
    cin>>S.at(i)>>P.at(i);
  }
  
  vector<string>R(N);
  

  
   for(int i=0;i<N;i++){
  
  sort(S.begin(),S.end());
  
    R.at(i)=S.at(i);
   }
  
  for(int i=0;i<N;i++){
    
    for(int j=0;j<N;j++){
      
      int sum=0;
      
  if(S.at(i)==R.at(j)){
    sum++;
    if(sum==0&&S.at(i+1)!=R.at(j)){
      cout<<j<<endl;
    }
    else if(sum>0&&S.at(i+1)!=R.at(j)){
      int Z=0;
      vector<int>T(sum);
      for(int k=0;k<N;k++){
        if(S.at(k)==S.at(i)){
          X++:
          
          T.at(X-1)=P.at(k);
       
      }
      sort(T.begin(),T.end());
      
      for(int l=sum;l>0;l--){
          if(T.at(l)==P.at(i)){
            cout<<j-l+1<<endl;
          }
      }
      }
    }
  }
    }
    
            
        
    }
    
        
      
      
    
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:42:11: error: 'X' was not declared in this scope
   42 |           X++:
      |           ^
a.cc:61:6: error: expected '}' at end of input
   61 |     }
      |      ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
/*
2019/05/26
*/
//sort

int main(){
  int n;
  cin>>n;
  int key[n];
  string name[n];
  int num[n];
  vector<int> ans(0, n);

  int i,j,temp;
  for (i = 0; i < n-1; i++) {
    for (j = n-1; j > i; j--) {
      if (compare(name[j-1],name[j])>0) {
        swap(name[j-1],name[j]);
        swap(num[j-1],num[j]);
        swap(key[j-1],key[j]);
      }
    }
  }
  for (i = 0; i < n-1; i++) {
    for (j = n-1; j > i; j--) {
      if (num[j-1]>num[j]) {
        swap(num[j-1],num[j]);
        swap(key[j-1],key[j]);
      }
    }
  }
  
  for(int i=0;i<n;i++)ans[i]=i+1;
  for (i = 0; i < n-1; i++) {
    for (j = n-1; j > i; j--) {
      if (key[j-1]<key[j]) {
        swap(num[j-1],num[j]);
      }
    }
  }
  for(int i:ans)cout<<i<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'compare' was not declared in this scope
   19 |       if (compare(name[j-1],name[j])>0) {
      |           ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;



//vector<pair<int,int>> pairs;  pairs[i] = make_pair(value, value);
//sort(a.begin(),a+index_number);

//cin>>  cout<<'\n'

/*
vector<int> vec(100,-1);全ての値に-1をセット
vector<std::vector<int>> vec{{ 1, 2, 3 },{ 4, 5, 6 }};
vec.size() vec[i].size()
vec.emplace_back(20);追加
*/

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
	int n;
	cin >> n;
	vector<pair<string,int>> m;
	m.reserved(n);

	vector<int> t(101,0);
	

	string y;
	int a;
	rep(i,n){
		cin >> y >> a;
		m[i] = (make_pair(y,a));
		t[a] = i;
	}


	sort(m.begin(),m.begin()+n);
	


	int c = 0;
	int s = 0;
	int e = 0;

	for(int i = 0;i<n;i++){
		
		if(m[i].first != m[i+1].first){

			for(int j = e; j >= s;j--){
				cout << t[m[j].second]+1 <<'\n';
			}
			s = i+1;
		}
		else
		{
		e = i+1;
		}
		
			
	}


	



    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:11: error: 'class std::vector<std::pair<std::__cxx11::basic_string<char>, long long int> >' has no member named 'reserved'; did you mean 'reserve'?
   31 |         m.reserved(n);
      |           ^~~~~~~~
      |           reserve
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class B {
    public static void main(String[] args) throws Exception {
        
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        int n = Integer.parseInt(br.readLine());
    
        String s[] = new String[n];
        Integer p[] = new Integer[n];
        Integer suffix[] = new Integer[n];

        for(int i=0;i<suffix.length;i++)
            suffix[i] = i;

        for(int i=0;i<n;i++){
            String str = new String(br.readLine());
            s[i] = str.split("\\s+")[0];
            p[i] = Integer.parseInt(str.split("\\s+")[1]);
        }
      
        for(int j=0;j<s.length;j++){
            for(int k=s.length-1;k>j;k--){
                if(s[j].compareTo(s[k]) > 0){
                    String str = s[j];
                    s[j] = s[k];
                    s[k] = str;

                    int c = p[j];
                    p[j] = p[k];
                    p[k] = c;

                    int st = suffix[j];
                    suffix[j] = suffix[k];
                    suffix[k] = st;
                }
            }
        }



        ArrayList<Integer> l = new ArrayList<Integer>();
        for(int i=0;i<s.length;i++){
            
            for(int j=i;j<s.length;j++){
                if(s[i].equals(s[j])) l.add(p[j]);                
            }

            for(int k=0;k<l.size();k++){
                for(int m=l.size()-1;m<k;m--){
                    if(l.get(k)>l.get(m)){
                        int tp = l.get(k);
                        l.set(k,l.get(m));
                        l.set(m,tp);

                        int st = suffix[k];
                        suffix[k] = suffix[m];
                        suffix[m] = st;
                    }
                }
            }

        }

        for(int i=0;i<s.length;i++)
            System.out.println(s[i] + "   " + p[i] + "   " + suffix[i]);

    }
}

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

#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	string A[20], sub1;
	int B[20], sub2, C[20], N;
	int i, j;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> A[i] >> B[i];
		C[i] = i + 1;
	}
	for (i = 0; i < N-1; i++) {
		for (j = i + 1; j < N; j++) {
			if (A[i] >= A[j]) {
				sub1 = A[i];
				A[i] = A[j];
				A[j] = sub1;
				sub2 = B[i];
				B[i] = B[j];
				B[j] = sub2;
				sub2 = C[i];
				C[i] = C[j];
				C[j] = sub2;
			}
		}
	}
	for (i = 0; i < N - 1; i++) {
		for (j = i + 1; j < N; j++) {
			if (A[i] == A[j]) {
				if (B[i] < B[j]) {
					sub1 = A[i];
					A[i] = A[j];
					A[j] = sub1;
					sub2 = B[i];
					B[i] = B[j];
					B[j] = sub2;
					sub2 = C[i];
					C[i] = C[j];
					C[j] = sub2;
				}
			}
		}
	for (i = 0; i < N; i++)
		cout << C[i] << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:2: error: expected '}' at end of input
   51 | }
      |  ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C

#include <stdio.h>
#include <string.h>
typedef struct{
  int num;
  char name[10];
  int p;
}R;

int main(void){
  int i,j,N;
  R temp,rest[100];
  scanf("%d",&N);
  for(i=0;i<N;i++){
    rest[i].num = i+1;
    scanf("%s %d",rest[i].name,&rest[i].p);
  }
  for(j=0;j<N-1;j++){
    for(i=0;i<N-1;i++){
      if(strcmp(rest[i].name,rest[i+1].name) == 0){
        if(rest[i].p < rest[i+1].p){
          temp.num = rest[i].num;      temp.p = rest[i].p;
          rest[i].num = rest[i+1].num; rest[i].p = rest[i+1].p;
          rest[i+1].num = temp.num;    rest[i+1].p = temp.p;
        }
      }else if(strcmp(rest[i].name,rest[i+1].name) > 0){
        temp.num = rest[i].num;      strcpy(temp.name,rest[i].name);      temp.p \
= rest[i].p;
        rest[i].num = rest[i+1].num; strcpy(rest[i].name,rest[i+1].name); rest[i]\
.p = rest[i+1].p;
        rest[i+1].num = temp.num;    strcpy(rest[i+1].name,temp.name);    rest[i+\
1].p = temp.p;
      }
    }
  }
  for(i=0;i<N;i++)
    printf("%d\n",rest[i].num);
  return 0;

Compiler output:
main.c: In function 'main':
main.c:37:3: error: expected declaration or statement at end of input
   37 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

#define mod 10e9+7
#define ll long long int

typedef struct res
{
    int num;
    char city[11];
    int point;
};

int compare_int(const void *a, const void *b)
{
    return (*(res**)a->point - *(res**)b->point);
}

int string_compar(const void *a, const void *b)
{
    return(strcmp(*(char**)a, *(char**)b));
}
int main(void){
    int n;
    scanf("%d", &n);
    struct res resta[n];
    for(int i = 0;i < n;i++){
        scanf("%s %d", &resta[i].city, &resta[i].point);
        resta[i].num = i+1;
    }
    qsort(resta, n, sizeof(struct res), compare_int);
    qsort(resta, n, sizeof(struct res), string_compar);
    for(int i = 0;i < n;i++){
        printf("%d\n", resta[i].num);
    }
    return 0;
}

Compiler output:
main.c:14:1: warning: useless storage class specifier in empty declaration
   14 | };
      | ^
main.c: In function 'compare_int':
main.c:18:15: error: 'res' undeclared (first use in this function)
   18 |     return (*(res**)a->point - *(res**)b->point);
      |               ^~~
main.c:18:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:20: error: expected expression before ')' token
   18 |     return (*(res**)a->point - *(res**)b->point);
      |                    ^
Language: C++

#include <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
    int n,p,x=1;
    string s;
    cin >> n;
    vector<pair<string,int>> r(n),c(n);
    for(int i=0;i<n;i++){
        cin >> s >> p;
        r[i].first=s;
        r[i].second=-1000*p-x;
    }
    sort(r.begin(),r.end());
    for(int i=0;i<n;i++){
        int y=e[i].second;
        cout << (-1*y)%10 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: 'e' was not declared in this scope
   20 |         int y=e[i].second;
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
using namespace std;
 
int main() {
	int n, i, j;
	cin >> n;
	char s[55][10];
	int p[55];
	for (i = 0; i < n; i++) {
		cin >> s[i] >> p[i];
	}
	int m[10];
	int sa, sai, sais, max = 0, flag = 0;
	while (1) {
		for (i = 0; i < 10; i++) {
			m[i] = 123;
		}
		max = 0;
		sa = -1;
		for (i = 0; i < n; i++) {
			for (j = 0; j < 10; j++) {
				if (s[i][j] < m[j]) {
					m[j] = s[i][j];
					sa = i;
					break;
				}
				else if (s[i][j] > m[j]) {
					break;
				}
			}
		}
		if (sa == -1)
			break;
		while (1) {
			for (i = 0; i < n; i++) {
				if (s[i] == s[sa]) {
					if (p[i] > max) {
						max = p[i];
						sais = i;
						flag = 1;
					}
				}
			}
			max = 0;
			p[sais] = 0;
			if (flag == 0)
				break;
			flag = 0;
			cout << sais + 1 << endl;
		}
		for (i = 0; i < n; i++) {
			if (s[i] == s[sa])
				s[i][0] = '|';
		}
	}
	return 0;
}
#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main() {
	int n, i, j;
	cin >> n;
	char s[n][10];
	int p[n];
	for (i = 0; i < n; i++) {
		cin >> s[i] >> p[i];
	}
	int m[10];
	int sa, sai, sais, max = 0, flag = 0;
	while (1) {
		for (i = 0; i < 10; i++) {
			m[i] = 123;
		}
		max = 0;
		sa = -1;
		for (i = 0; i < n; i++) {
			for (j = 0; j < 10; j++) {
				if (s[i][j] < m[j]) {
					m[j] = s[i][j];
					sa = i;
					break;
				}
				else if (s[i][j] > m[j]) {
					break;
				}
			}
		}
		if (sa == -1)
			break;
		while (1) {
			for (i = 0; i < n; i++) {
				if (s[i] == s[sa]) {
					if (p[i] > max) {
						max = p[i];
						sais = i;
						flag = 1;
					}
				}
			}
			max = 0;
			p[sais] = 0;
			if (flag == 0)
				break;
			flag = 0;
			cout << sais + 1 << endl;
		}
		for (i = 0; i < n; i++) {
			if (s[i] == s[sa])
				s[i][0] = '|';
		}
	}
	return 0;
}

Compiler output:
a.cc:65:5: error: redefinition of 'int main()'
   65 | int main() {
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main() {
      |     ^~~~
Language: Java

import java.util.Scanner;
public class Main{
 public class city{
    String name;
    int sc;
    int id;
  }
  public static void main(String[] args){
    Scannar sc = new Scanner(System.in);
    int N,i,j;
    N = sc.nextInt();
    city[] C = new city[N];
    int temp;
    for(i=0;i<N;i++){
      C[i].name = sc.nextLine();
      C[i].sc = sc.nextInt();
      C[i].id = i;
    }
    for (i = 0; i < N; i++) 
        {
            for ( j = i + 1; j < N; j++) 
            {
                if (C[i].name.compareTo(C[j].name)>0) 
                {
                    temp = C[i].id;
                    C[i].id = C[j].id;
                    C[j].id = temp;
                }
            }
        }
    for(i=0;i<N;i++){
      for(j=i+1;j<N;j++){
        if(C[i].name.equals(C[j].name)){
          if(C[i].sc<C[j].sc){
            temp = C[i].id;
            C[i].id = C[j].id;
            C[j].id = temp;
          }
        }
      }
    }
  for(j=0;j<N;j++)
   System.out.println(C[i].id + "\n");
  }
}
    


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

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


  
  struct fruit {
  string name;  // 名前
  int    price; 
  int num;  // 価格
};

int main(){
  int N; cin >> N;
  int a,b;

fruit  fruits[110] ;
  
for(int i=0;i<N;i++){
  cin >> a >> b;
  fruits[i].name = a;
  fruits[i].price = b;
  fruits[i].num = (i+1);
}
  
  
  
// nameをキーに昇順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.name < y.name;});

// priceをキーに降順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.price > y.price;});
for(int i=0;i<N;i++)
  cout << fruits[i].num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: request for member 'begin' in 'fruits', which is of non-class type 'fruit [110]'
   28 | sort(fruits.begin(), fruits.end(),
      |             ^~~~~
a.cc:28:29: error: request for member 'end' in 'fruits', which is of non-class type 'fruit [110]'
   28 | sort(fruits.begin(), fruits.end(),
      |                             ^~~
a.cc:32:13: error: request for member 'begin' in 'fruits', which is of non-class type 'fruit [110]'
   32 | sort(fruits.begin(), fruits.end(),
      |             ^~~~~
a.cc:32:29: error: request for member 'end' in 'fruits', which is of non-class type 'fruit [110]'
   32 | sort(fruits.begin(), fruits.end(),
      |                             ^~~
Language: Java

import java.util.Scanner;
public class Main{
  class city{
    String name;
    int sc;
    int id;
  }
  public static void main(String[] args){
    Scannar sc = new Scanner(System.in);
    int N,i,j;
    N = sc.nextInt();
    city[] C = new city[N];
    int temp;
    for(i=0;i<N;i++){
      C[i].name = sc.nextLine();
      C[i].sc = sc.nextInt();
      C[i].id = i;
    }
    for (i = 0; i < N; i++) 
        {
            for ( j = i + 1; j < N; j++) 
            {
                if (C[i].name.compareTo(C[j].name)>0) 
                {
                    temp = C[i].id;
                    C[i].id = C[j].id;
                    C[j].id = temp;
                }
            }
        }
    for(i=0;i<N;i++){
      for(j=i+1;j<N;j++){
        if(C[i].name.equals(C[j].name)){
          if(C[i].sc<C[j].sc){
            temp = C[i].id;
            C[i].id = C[j].id;
            C[j].id = temp;
          }
        }
      }
    }
  for(j=0;j<N;j++)
   System.out.println(C[i].id + "\n");
  }
}
    


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

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

int main()
{
  int i,j,N;
  int m=0;
  cin >> N;
  char moji[N][30], tmp[30];
  int num[N];
  for(i=0;i<N;i++){
    scanf("%s",moji[i]);
    scanf("%d",num[i]);
  }
  for(i=1;i<N;i++){
    for(j=1;j<N;j++){
      if(strcmp(moji[j-1],moji[j])>0){
        strcpy(tmp,moji[j-1]);
        for(int h=1;h<N;h++){
          strcpy(moji[h-1],moji[h]);
        }
        strcpy(moji[N-1],tmp)
      }
      if(strcmp(moji[j-1],moji[j])==0){
        if(num[j-1]<num[j]){
          m=num[j-1];
          num[j-1]=num[j];
          num[j]=m;
        }
      }
    }
    for(i=0;i<N;i++){
      printf("%s%d\n",moji[i],num[i]);
    }
  }
          
      


Compiler output:
a.cc: In function 'int main()':
a.cc:22:30: error: expected ';' before '}' token
   22 |         strcpy(moji[N-1],tmp)
      |                              ^
      |                              ;
   23 |       }
      |       ~                       
a.cc:35:4: error: expected '}' at end of input
   35 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: Java

import java.util.Scanner;
public class Main{
  class city{
    String name;
    int sc;
    int id;
  }
  public static void main(String[] args){
    Scannar sc = new Scanner(System.in);
    int N,i,j;
    N = sc.nextInt();
    city[] C = new city[N];
    int temp;
    for(i=0;i<N;i++){
      C[i].name = sc.nextLine();
      C[i].sc = sc.nextInt();
      C[i].id = i;
    }
    for (i = 0; i < N; i++) 
        {
            for (int j = i + 1; j < N; j++) 
            {
                if (C[i].name.compareTo(C[j].name)>0) 
                {
                    temp = C[i].id;
                    C[i].id = C[j].id;
                    C[j].id = temp;
                }
            }
        }
    for(i=0;i<N;i++){
      for(j=i+1;j<N;j++){
        if(C[i].name.equals(C[j].name)){
          if(C[i].sc<C[j].sc){
            temp = C[i].id;
            C[i].id = C[j].id;
            C[j].id = temp;
          }
        }
      }
    }
  for(j=0;j<N;j++)
   System.out.println(C[i].id + "\n");
  }
}
    


Compiler output:
Main.java:9: error: cannot find symbol
    Scannar sc = new Scanner(System.in);
    ^
  symbol:   class Scannar
  location: class Main
Main.java:21: error: variable j is already defined in method main(String[])
            for (int j = i + 1; j < N; j++) 
                     ^
2 errors
Language: Java

import java.util.Scanner;
public class Main{
  class city{
    String name;
    int sc;
    int id;
  }
  public static void main(String[] args){
    Scannar sc = new Scanner(System.in);
    int N,i,j;
    N = sc.nextInt();
    city[] C = new city[N];
    int temp;
    for(i=0;i<N;i++){
      C[i].name = sc.nextLine();
      C[i].sc = sc.nextInt();
      C[i].id = i;
    }
    for (i = 0; i < N; i++) 
        {
            for (int j = i + 1; j < N; j++) 
            {
                if (C[i].name.compareTo(C[j].name)>0) 
                {
                    temp = C[i].id;
                    C[i].id = C[j].id;
                    C[j].id = temp;
                }
            }
        }
    for(i=0;i<N;i++){
      for(j=i+1;j<N;j++){
        if(C[i].name.equals(C[j].name)){
          if(C[i].sc<C[j].sc){
            temp = C[i].id;
            C[i].id = C[j].id;
            C[j].id = temp;
          }
        }
      }
    }
  for(j=0;j<N;j++)
   System.out.println(C[i].id + "\n");
    
    

Compiler output:
Main.java:43: error: reached end of file while parsing
   System.out.println(C[i].id + "\n");
                                      ^
1 error
Language: C++

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


  
  struct fruit {
  string name;  // 名前
  int    price; 
  int num;  // 価格
};

int main(){
  int N; cin >> N;
  int a,b;

fruit fruits[110];
  
for(int i=0;i<N;i++){
  cin >> a >> b;
  fruits[i].name = a;
  fruits[i].price = b;
  fruits[i].num = (i+1);
}
  
  
  
// nameをキーに昇順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.name < y.name;});

// priceをキーに降順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.price > y.price;});
for(int i=0;i<N;i++)
  cout << fruits[i].num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: request for member 'begin' in 'fruits', which is of non-class type 'fruit [110]'
   28 | sort(fruits.begin(), fruits.end(),
      |             ^~~~~
a.cc:28:29: error: request for member 'end' in 'fruits', which is of non-class type 'fruit [110]'
   28 | sort(fruits.begin(), fruits.end(),
      |                             ^~~
a.cc:32:13: error: request for member 'begin' in 'fruits', which is of non-class type 'fruit [110]'
   32 | sort(fruits.begin(), fruits.end(),
      |             ^~~~~
a.cc:32:29: error: request for member 'end' in 'fruits', which is of non-class type 'fruit [110]'
   32 | sort(fruits.begin(), fruits.end(),
      |                             ^~~
Language: C++

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


  
  struct fruit {
  string name;  // 名前
  int    price; 
  int num;  // 価格
};

int main(){
  int N; cin >> N;
  int a,b;

vector<fruit> fruits[110];
  
for(int i=0;i<N;i++){
  cin >> a >> b;
  fruits[i].name = a;
  fruits[i].price = b;
  fruits[i].num = (i+1);
}
  
  
  
// nameをキーに昇順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.name < y.name;});

// priceをキーに降順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.price > y.price;});
for(int i=0;i<N;i++)
  cout << fruits[i].num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'class std::vector<fruit>' has no member named 'name'
   20 |   fruits[i].name = a;
      |             ^~~~
a.cc:21:13: error: 'class std::vector<fruit>' has no member named 'price'
   21 |   fruits[i].price = b;
      |             ^~~~~
a.cc:22:13: error: 'class std::vector<fruit>' has no member named 'num'
   22 |   fruits[i].num = (i+1);
      |             ^~~
a.cc:28:13: error: request for member 'begin' in 'fruits', which is of non-class type 'std::vector<fruit> [110]'
   28 | sort(fruits.begin(), fruits.end(),
      |             ^~~~~
a.cc:28:29: error: request for member 'end' in 'fruits', which is of non-class type 'std::vector<fruit> [110]'
   28 | sort(fruits.begin(), fruits.end(),
      |                             ^~~
a.cc:32:13: error: request for member 'begin' in 'fruits', which is of non-class type 'std::vector<fruit> [110]'
   32 | sort(fruits.begin(), fruits.end(),
      |             ^~~~~
a.cc:32:29: error: request for member 'end' in 'fruits', which is of non-class type 'std::vector<fruit> [110]'
   32 | sort(fruits.begin(), fruits.end(),
      |                             ^~~
a.cc:35:21: error: 'class std::vector<fruit>' has no member named 'num'
   35 |   cout << fruits[i].num << endl;
      |                     ^~~
Language: C++

template < typename T > std::string to_string( const T& n )
 {
        std::ostringstream stm ;
        stm << n ;
        return stm.str() ;
}

//
// Created by 高山拓夢 on 2019-05-26.
//

#include <iostream>
#include <algorithm>
using namespace std;

int main() {

    int N;          // 要素数
    string a[100];
    string p[100];
    string con[100];
    cin >> N;

    for (int i = 0; i < N; ++i){

        int tem;

        cin >> a[i] >> tem;
        p[i] = to_string(100 - tem);

        if(p[i].compare("100") == 0)
            con[i] = a[i] + "999" + to_string(i + 1);
        else
            con[i] = a[i] + p[i] + to_string(i + 1);
    }

    sort(con, con + N);  // a[0:N] を小さい順にソート

    // 出力
    for (int i = 0; i < N; ++i) cout << con[i].substr((int)(con[i].length()-1),1) << "\n";

    return 0;

}

Compiler output:
a.cc:1:30: error: 'string' in namespace 'std' does not name a type
    1 | template < typename T > std::string to_string( const T& n )
      |                              ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | template < typename T > std::string to_string( const T& n )
Language: C++

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


  
  struct fruit {
  string name;  // 名前
  int    price; 
  int num;  // 価格
};

int main(){
  int N; cin >> N;
  int a,b;

vector<fruit> fruits;
  
for(int i=0;i<N;i++){
  cin >> a >> b;
  fruits[i].name.push = a;
  fruits[i].price = b;
  fruits[i].num = (i+1);
}
  
  
  
// nameをキーに昇順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.name < y.name;});

// priceをキーに降順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.price > y.price;});
for(int i=0;i<N;i++)
  cout << fruit[i].num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'push'
   20 |   fruits[i].name.push = a;
      |                  ^~~~
a.cc:35:16: error: expected primary-expression before '[' token
   35 |   cout << fruit[i].num << endl;
      |                ^
Language: C++

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

int main()
{
  int i,j,N;
  int m=0;
  cin >> N;
  char moji[N][30], tmp[30];
  int num[N];
  for(i=0;i<N;i++){
    scanf("%s",moji[i]);
    scanf("%d",num[i]);
  }
  for(i=1;i<N;i++){
    for(j=1;j<N;j++){
      if(strcmp(moji[j-1],moji[j])>0){
        strcpy(tmp,moji[j-1]);
        for(int h=1;h<N;h++){
          strcpy(moji[h-1],moji[h]);
        }
        strcpy(moji[N-1],tmp)+
      }
      if(strcmp(moji[j-1],moji[j])==0){
        if(num[j-1]<num[j]){
          m=num[j-1];
          num[j-1]=num[j];
          num[j]=m;
        }
      }
    }
    for(i=0;i<N;i++){
      printf("%s%d\n",moji[i],num[i]);
    }
  }
          
      


Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: expected primary-expression before '}' token
   23 |       }
      |       ^
a.cc:35:4: error: expected '}' at end of input
   35 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

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

int main()
{
  int i,j,N;
  int m=0;
  cin >> N;
  char moji[N][], tmp[];
  int num[N];
  for(i=0;i<N;i++){
    scanf("%s",moji[i]);
    scanf("%d",num[i]);
  }
  for(i=1;i<N;i++){
    for(j=1;j<N;j++){
      if(strcmp(moji[j-1],moji[j])>0){
        strcpy(tmp,moji[j-1]);
        for(int h=1;h<N;h++){
          strcpy(moji[h-1],moji[h]);
        }
        strcpy(moji[N-1],tmp)+
      }
      if(strcmp(moji[j-1],moji[j])==0){
        if(num[j-1]<num[j]){
          m=num[j-1];
          num[j-1]=num[j];
          num[j]=m;
        }
      }
    }
    for(i=0;i<N;i++){
      printf("%s%d\n",moji[i],num[i]);
    }
  }
          
      


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: declaration of 'moji' as multidimensional array must have bounds for all dimensions except the first
    9 |   char moji[N][], tmp[];
      |        ^~~~
a.cc:9:19: error: storage size of 'tmp' isn't known
    9 |   char moji[N][], tmp[];
      |                   ^~~
a.cc:12:16: error: 'moji' was not declared in this scope
   12 |     scanf("%s",moji[i]);
      |                ^~~~
a.cc:17:17: error: 'moji' was not declared in this scope
   17 |       if(strcmp(moji[j-1],moji[j])>0){
      |                 ^~~~
a.cc:23:7: error: expected primary-expression before '}' token
   23 |       }
      |       ^
a.cc:24:17: error: 'moji' was not declared in this scope
   24 |       if(strcmp(moji[j-1],moji[j])==0){
      |                 ^~~~
a.cc:33:23: error: 'moji' was not declared in this scope
   33 |       printf("%s%d\n",moji[i],num[i]);
      |                       ^~~~
a.cc:35:4: error: expected '}' at end of input
   35 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<iostream>

using namespace std;

class rest {
public:
		int point;
		char name[11];
		int num;
	};

int main() {
	int i;
	cin >> i;
	rest*ob = new rest[i];
	for (int n=0; n < i; n++) {
		ob[n].num = n + 1;
		cin >> ob[n].name >> ob[n].point;
	}

	int num=i;

	rest obtmp;

	for (int i = 1; i < num; i++) {
		for (int j = 1; j < num; j++) {
			if (strcmp(ob[j - 1].name, ob[j].name) > 0) {
				obtmp = ob[j - 1];
				ob[j - 1] = ob[j];
				ob[j] = obtmp;
			}
			else if(strcmp(ob[j - 1].name, ob[j].name) == 0) {
				if (ob[j - 1].point < ob[j].point) {
					obtmp = ob[j - 1];
					ob[j - 1] = ob[j];
					ob[j] = obtmp;
				}
			}
		}
	}
	for (int n = 0; n < i; n++) {
		cout << ob[n].num<<"\n";
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:29: error: 'strcmp' was not declared in this scope
   27 |                         if (strcmp(ob[j - 1].name, ob[j].name) > 0) {
      |                             ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

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

int main()
{
  int i,j,N;
  int m=0;
  cin >> N;
  char moji[N][],tmp[];
  int num[N];
  for(i=0;i<N;i++){
    scanf("%s",moji[i]);
    scanf("%d",num[i]);
  }
  for(i=1;i<N;i++){
    for(j=1;j<N;j++){
      if(strcmp(moji[j-1],moji[j])>0){
        strcpy(tmp,moji[j-1]);
        for(int h=1;h<N;h++){
          strcpy(moji[h-1],moji[h]);
        }
        strcpy(moji[N-1],tmp)+
      }
      if(strcmp(moji[j-1],moji[j])==0){
        if(num[j-1]<num[j]){
          m=num[j-1];
          num[j-1]=num[j];
          num[j]=m;
        }
      }
    }
    for(i=0;i<N;i++){
      printf("%s%d\n",moji[i],num[i]);
    }
  }
          
      

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: declaration of 'moji' as multidimensional array must have bounds for all dimensions except the first
    9 |   char moji[N][],tmp[];
      |        ^~~~
a.cc:9:18: error: storage size of 'tmp' isn't known
    9 |   char moji[N][],tmp[];
      |                  ^~~
a.cc:12:16: error: 'moji' was not declared in this scope
   12 |     scanf("%s",moji[i]);
      |                ^~~~
a.cc:17:17: error: 'moji' was not declared in this scope
   17 |       if(strcmp(moji[j-1],moji[j])>0){
      |                 ^~~~
a.cc:23:7: error: expected primary-expression before '}' token
   23 |       }
      |       ^
a.cc:24:17: error: 'moji' was not declared in this scope
   24 |       if(strcmp(moji[j-1],moji[j])==0){
      |                 ^~~~
a.cc:33:23: error: 'moji' was not declared in this scope
   33 |       printf("%s%d\n",moji[i],num[i]);
      |                       ^~~~
a.cc:35:4: error: expected '}' at end of input
   35 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <string>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

int main(){
    int n;
    cin >> n;
    string s[n], t[n];
    int p;
    string sp;
    for(int i = 0; i < n; i++){
        cin >> s[i] >> p;
        sp = to_string(100-p);
        if(sp == "100") sp = "999";
        if(sp == "0") sp = "000";
        t[i] = s[i] + sp;
        s[i] += sp;
    }
    sort(t, t+n);
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(t[i] == s[j]) cout << j + 1 << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> n;
      |     ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <map>
  +++ |+#include <iostream>
    5 | 
a.cc:25:30: error: 'cout' was not declared in this scope
   25 |             if(t[i] == s[j]) cout << j + 1 << endl;
      |                              ^~~~
a.cc:25:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:47: error: 'endl' was not declared in this scope
   25 |             if(t[i] == s[j]) cout << j + 1 << endl;
      |                                               ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <map>
  +++ |+#include <ostream>
    5 |
Language: C++

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


  
  struct fruit {
  string name;  // 名前
  int    price; 
  int num;  // 価格
};

int main(){
  int N; cin >> N;
  int a,b;

vector<fruit> fruits;
  
for(int i=0;i<N;i++){
  cin >> a >> b;
  fruit.name.push(a);
  fruit.price.push(b);
  fruit.num.push(i+1);
}
  
  
  
// nameをキーに昇順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.name < y.name;});

// priceをキーに降順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.price > y.price;});
for(int i=0;i<N;i++)
  cout << fruit[i].num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: expected unqualified-id before '.' token
   20 |   fruit.name.push(a);
      |        ^
a.cc:21:8: error: expected unqualified-id before '.' token
   21 |   fruit.price.push(b);
      |        ^
a.cc:22:8: error: expected unqualified-id before '.' token
   22 |   fruit.num.push(i+1);
      |        ^
a.cc:35:16: error: expected primary-expression before '[' token
   35 |   cout << fruit[i].num << endl;
      |                ^
Language: C++

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


  
  struct fruit {
  string name;  // 名前
  int    price; 
  int num;  // 価格
};

int main(){
  int N; cin >> N;
  int a,b;

vector<fruit> fruits;
  
for(int i=0;i<N;i++){
  cin >> a >> b;
  fruit.name.push(a);
  fruit.price.push(b);
  fruit.num.push(i+1);
}
  
  
  
// nameをキーに昇順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.name < y.name;});

// priceをキーに降順でソート
sort(fruits.begin(), fruits.end(), 
     [](const fruit& x, const fruit& y) { return x.price > y.price;});
for(int i=0;i<N;i++)
  cout << fruit[i].num << endl;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++: No such file or directory
    1 | #include<bits/stdc++>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

class B128{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        Map<String, Integer> m = new TreeMap<String, Integer>();

        for(int i = 0; i < n; i++){
            m.put(sc.next(),sc.nextInt());
        }

        Iterator<String> it = m.keySet().Iterator();
        while(it.hasNext()){
            String key = it.next();
            System.out.println(Treemap.get(key));
        }

    }
}

Compiler output:
Main.java:14: error: cannot find symbol
        Iterator<String> it = m.keySet().Iterator();
                                        ^
  symbol:   method Iterator()
  location: interface Set<String>
Main.java:17: error: cannot find symbol
            System.out.println(Treemap.get(key));
                               ^
  symbol:   variable Treemap
  location: class B128
2 errors
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<string> vec(n);
  vector<int> bek(n);
  for(int i=0; i<n; i++){
    cin >> vec.at(i);
    for(int i=0; i<n; i++){
      cin >> bek.at(i);
    }
  }
  sort(vec.begin(),vec.end());
  for(int y=0;y<n;y++){
  if(vec.at(i)=vec.at(i+1)){
    min(vec.,)
  }
  }
  for(int r=0;r<n; r++){
    cout << r+1 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'i' was not declared in this scope
   19 |   if(vec.at(i)=vec.at(i+1)){
      |             ^
a.cc:20:13: error: expected unqualified-id before ',' token
   20 |     min(vec.,)
      |             ^
a.cc:20:14: error: expected primary-expression before ')' token
   20 |     min(vec.,)
      |              ^
Language: C++

#include <iostream>
#include <string>
#include <utility>
using namespace std;
int main(){
	int n;
	pair<string, int> p[100];
	cin >> n;
	string s;
	int p2;
	for(int i = 0;i < n;i++){
		cin >> s >> p2;
		p2 = (101 - p2) * 100 + i;
		p[i] = make_pair(s, p2);
	}
	sort(p, p + n);
	for(int i = 0;i < n;i++){
		cout << (p[i].second % 100 + 1) << endl;
	}
}

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

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


int main(void)
{
  int N;
  int t1;
  cin >> N;
  string S;
  vector<int> P(N);
  vector<int> t(N);
  vector<int> c(N);
  for(int i=0;i<N;i++)
  {
    cin >> S >> P.at(i);
    if(S.at(0)='a') t.at(i)=1;
    if(S.at(0)='b') t.at(i)=2;
    if(S.at(0)='c') t.at(i)=3;
    if(S.at(0)='d') t.at(i)=4;
    if(S.at(0)='e') t.at(i)=5;
    if(S.at(0)='f') t.at(i)=6;
    if(S.at(0)='g') t.at(i)=7;
    if(S.at(0)='h') t.at(i)=8;
    if(S.at(0)='i') t.at(i)=9;
    if(S.at(0)='j') t.at(i)=10;
    if(S.at(0)='k') t.at(i)=11;
  	if(S.at(0)='l') t.at(i)=12;
    if(S.at(0)='n') t.at(i)=13;
    if(S.at(0)='m') t.at(i)=14;
    if(S.at(0)='o') t.at(i)=15;
    if(S.at(0)='p') t.at(i)=16;
    if(S.at(0)='q') t.at(i)=17;
    if(S.at(0)='r') t.at(i)=18;
    if(S.at(0)='s') t.at(i)=19;
    if(S.at(0)='t') t.at(i)=20;
    if(S.at(0)='u') t.at(i)=21;
    if(S.at(0)='v') t.at(i)=22;
    if(S.at(0)='w') t.at(i)=23;
    if(S.at(0)='x') t.at(i)=24;
    if(S.at(0)='y') t.at(i)=25;
    if(S.at(0)='z') t.at(i)=26;
    c.at(i)=i+1;
    
  }
  
	for(int i=0;i<N;i++){
      for(int j=i;j>0;j--){
        if(t.at(j)<t.at(j-1) && p.at(j) <=p.at(j-1)){
          t1=c.at(j);
          c.at(j)=c.at(j-1);
          c.at(j-1)=t1;
        }else if(t.at(j)<t.at(j-1)){
          t1=c.at(j);
          c.at(j)=c.at(j-1);
          c.at(j-1)=t1;
        }
      }
    }
  
  for(int i=0;i<N;i++){
    cout << c.at(i) << endl;
  }
  return 0;
}

          

Compiler output:
a.cc: In function 'int main()':
a.cc:49:33: error: 'p' was not declared in this scope
   49 |         if(t.at(j)<t.at(j-1) && p.at(j) <=p.at(j-1)){
      |                                 ^