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

#include<iostream>
using namespace std;


char in[120];
pair<pair<string,int>,int> p[110];

int main(){
  int a;
  cin >> a;
  for(int i=0;i<a;i++){
    int t;
    scanf("%s%d",in,&t);
    p[i]=make_pair(make_pair(in,-t),i);
  }
  sort(p,p+a);
  for(int i=0;i<a;i++){
    printf("%d\n",p[i].second+1);
  }
}


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

#include<iostream>
using namespace std;

string in;
//char in[120];
pair<pair<string,int>,int> p[110];

int main(){
  int a;
  cin >> a;
  for(int i=0;i<a;i++){
    int t;
    cin >> in >> t;
    //scanf("%s%d",in,&t);
    p[i]=make_pair(make_pair(in,-t),i);
  }
  sort(p,p+a);
  for(int i=0;i<a;i++){
    printf("%d\n",p[i].second+1);
  }
}


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

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

class Obj{
  private:
  	string name;
  	int sort;
  public:
  	void set_name(string n){
      name = n;
    };
  	string get_name(){
      return name;
    };
  	void set_sort(int i){
      sort = i;
    };
  	int get_sort(){
      return sort;
    };
};

int main(){
  int n;
  cin >> n;
  string s[n], p[n];
  Obj o[n];
  for(int i = 0; i < n; i++){
    cin >> s[i] >> p[i];
    s[i] = s[i] + " -" + p[i];
    o[i].set_name(s[i]);
    o[i].set_sort(i+1);
  }
  sort(get_o[0].name, get_o[n-1].name);
  for(int i = 0; i < n; i++){
    cout << o[i].get_sort << endl;
  }
  return 0;
}  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:36:8: error: 'get_o' was not declared in this scope
   36 |   sort(get_o[0].name, get_o[n-1].name);
      |        ^~~~~
a.cc:38:10: error: invalid use of non-static member function 'int Obj::get_sort()'
   38 |     cout << o[i].get_sort << endl;
      |     ~~~~~^~~~~~~~~~~~~~~~
a.cc:20:13: note: declared here
   20 |         int get_sort(){
      |             ^~~~~~~~
Language: C++

n = int(input())
town = []
for i in range(n):
    s, p = input().split()
    p = int(p)
    town.append([s, p, i + 1])

town.sort(key=lambda x: x[1], reverse=True)
town.sort(key=lambda x: x[0])

for i in town:
    print(i[2])


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

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <functional>
#include <queue>
#include <map>
#include <cstdio>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main(){
    char a[150];
    pair<pair<string, int>, int> p[150];
    int n;
    cin >> n;
    REP(i, n){
        int t;
        cin >> a >> t;
        string tmp = a;
        p[i] = make_pair(make_pair(a, -t), i);
    }
    sort(p, p+N);
    REP(i, n){
        cout << p[i].second + 1;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 'N' was not declared in this scope
   25 |     sort(p, p+N);
      |               ^
Language: C++

#include <stdio.h>
#include <string.h>
 
struct shop{
  int p;
  int index;
  char s[20];
};
 
int main(void){
  
  int n, ret; 
  ret = scanf("%d", &n);
  
  struct shop shops[n], tmp;
  
  for(int i = 0; i < n; i++){
    ret = scanf("%s %d", shops[i].s, &shops[i].p); 
    shops[i].index = i;
  }
  
  for(int i = 0; i < n; i++){
    for(int j = i+1; j < n; j++){
      if (strcmp(shops[i].s, shops[j].s) > 0) {
        tmp = shops[i];
        shops[i] = shops[j];
        shops[j] = tmp;
      }else if(strcmp(shops[i].s, shops[j].s) == 0){
      	if(shops[i].p < shops[j].p){
          tmp = shops[i];
          shops[i] = shops[j];
          shops[j] = tmp;
        }
      }
    }
  }
  
  for(int i = 0; i < n; i++){
   printf("%d\n", shops[i].index); 
  }
  
  return 0; 
}
#include <stdio.h>
#include <string.h>

struct shop{
  int p;
  int index;
  char s[20];
};

int main(void){
  
  int n; 
  scanf("%d", &n);
  
  struct shop shops[n], tmp;
  
  for(int i = 0; i < n; i++){
    scanf("%s %d", shops[i].s, &shops[i].p); 
    shops[i].index = i;
  }
  
  for(int i = 0; i < n; i++){
    for(int j = i+1; j < n; j++){
      if (strcmp(shops[i].s, shops[j].s) > 0) {
        tmp = shops[i];
        shops[i] = shops[j];
        shops[j] = tmp;
      }else if(strcmp(shops[i].s, shops[j].s) == 0){
      	if(shops[i].p < shops[j].p){
          tmp = shops[i];
          shops[i] = shops[j];
          shops[j] = tmp;
        }
      }
    }
  }
  
  for(int i = 0; i < n; i++){
   printf("%d\n", shops[i].index); 
  }
  
  return 0; 
}


Compiler output:
a.cc:47:8: error: redefinition of 'struct shop'
   47 | struct shop{
      |        ^~~~
a.cc:4:8: note: previous definition of 'struct shop'
    4 | struct shop{
      |        ^~~~
a.cc:53:5: error: redefinition of 'int main()'
   53 | int main(void){
      |     ^~~~
a.cc:10:5: note: 'int main()' previously defined here
   10 | int main(void){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, priority_queue<pair<int, int>> mp;
  for(int i = 0; i < n; ++i) {
    string s;
    int j;
    cin >> s >> j;
    mp[s].push(make_pair(j, i));
  }
  for(auto& p : mp) {
    auto& q = p.second;
    while(!q.empty()) {
      auto x = q.top();
      q.pop();
      cout << x.second+1 << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:46: error: template argument 2 is invalid
    6 |   map<string, priority_queue<pair<int, int>> mp;
      |                                              ^~
a.cc:6:46: error: template argument 4 is invalid
a.cc:11:5: error: 'mp' was not declared in this scope
   11 |     mp[s].push(make_pair(j, i));
      |     ^~
a.cc:13:17: error: 'mp' was not declared in this scope; did you mean 'p'?
   13 |   for(auto& p : mp) {
      |                 ^~
      |                 p
Language: C++

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

int main() {
  int N;
  cin >>N;
  vector<pair<string,pair<int,int>>> pe(N);
  for(i=0;i<N;i++){
    int a;
    cin >> pe[i].first >>a;
    pe[i].second.first=-a;
    pe[i].second.second=i+1;
  }
  sort(pe.begin(),pe.end());
  for(i=0;i<N;i++){
    cout << pe[i].second.second << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<N;i++){
      |       ^
a.cc:15:7: error: 'i' was not declared in this scope
   15 |   for(i=0;i<N;i++){
      |       ^
Language: C++

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

int main(){
  string s;
  int n,k;
  
  cin>>n;
  
  pair<pair<string,int>,int> p[n];
  for(int i=0;i<n;i++){
    cin>>s>>k;
    p[i] = make_pair(make_pair(s,-k), i+1);
  }
  
  sort(p,p+n);
  
  for(iny i=0;i<n;i++)
    cout<<p[i].second<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'iny' was not declared in this scope; did you mean 'int'?
   20 |   for(iny i=0;i<n;i++)
      |       ^~~
      |       int
a.cc:20:15: error: 'i' was not declared in this scope
   20 |   for(iny i=0;i<n;i++)
      |               ^
Language: Java

import java.util.*;
public class Main(){
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    HashMap<String, int> hashmap = new HashMap<String, int>();
    ArrayList <String> cities = new ArrayList<>();
    for (int i = 0; i < n; i++){
      String city = scanner.next();
      int score = scanner.nextInt();
      if(!cities.contains(city)) {
        cities.add(city);
      }
      hashmap.put(city, score);
    }
    for (int i = 0 ; i < cities.size() ; i++){
      String row = array.get(i);
      System.out.println(row);
    }
  }
}

Compiler output:
Main.java:2: error: '{' expected
public class Main(){
                 ^
1 error
Language: Java

package b;


import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.stream.Collectors;

final class Restaurant{
	int id;
	String name;
	int point;

	public Restaurant(int id, String name, int point) {
		super();
		this.id = id;
		this.name = name;
		this.point = point;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public int getPoint() {
		return point;
	}

}

public class B {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		List<Restaurant> restList;


		int n;

		n = sc.nextInt();

		restList = new ArrayList<>(n);

		String name;
		int point;
		for(int i = 1; i <=n; i++) {
			name = sc.next();
			point = sc.nextInt();
			Restaurant res = new Restaurant(i, name, point);
			restList.add(res);
		}


		Map<String, List<Restaurant>> restMap = restList.stream()
		.collect(Collectors.groupingBy(Restaurant::getName));

		restMap.keySet().stream()
		.sorted(Comparator.comparing(data -> data))
		.map(key -> restMap.get(key)
					.stream()
					.sorted(Comparator.comparing((Restaurant data) -> data.getPoint()).reversed())
					.collect(Collectors.toList())

		)
		.forEach(data ->
			{
				for(Restaurant elem : data) {
					System.out.println(elem.id);
				}
			}
			);

		sc.close();

	}


}


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

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

#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))



#define REP(i,n) for(i=0;i<n;i++)
//二次元配列の文字列を使いたくなったので代わりに構造体を使用した。

typedef struct{
  int a;
  char s[15];
  int p;
}Restaurant_t;

int strsort(const void*a, const void*b){//おまじない
  long long P = strcmp(((Restaurant_t*)a)->s,((Restaurant_t*)b)->s);
  long long Q = ((Restaurant_t*)b)->p-((Restaurant_t*)a)->p;
  if(P!=0){//名前が異なる
    return P;
  }else if(Q!=0){
    return Q;
  }else{
    return 0;
  }
}
}
int main(void)
{
  int i;
  int n;
  scanf("%d",&n);
  Restaurant_t Restaurant[n];
  REP(i,n){
    scanf("%s%d",Restaurant[i].s,&Restaurant[i].p);
    Restaurant[i].a = i+1;
  }
  qsort(Restaurant,n,sizeof(Restaurant_t),strsort);
  REP(i,n){
    printf("%d\n",Restaurant[i].a);
  }

  return 0;
}
/*int i;
i = strcmp("ai","aio");
printf("%d",i);

return 0;*/


Compiler output:
main.c:31:1: error: expected identifier or '(' before '}' token
   31 | }
      | ^
Language: C++

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

int main(){
  int n,score;
  char name;
  pair<pair<string,int>,int> p[110];
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> name >> score;
    p[i] = make_pair((name,-score),i);
  }
  sort(p,p+n);
  for(int i=0; i<n;i++){
    cout << p[i].second+1 <<endl;
  }
}
    

Compiler output:
a.cc:2:9: fatal error: bits/stdl_pair.h: No such file or directory
    2 | #include<bits/stdl_pair.h>
      |         ^~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int n,score;
  char name;
  pair<pair<string,int>,int> p[110];
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> name >> score;
    p[i] = make_pair((name,-scorer),i);
  }
  sort(p,p+n);
  for(int i=0; i<n;i++){
    cout << p[i].second+1 <<endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: 'scorer' was not declared in this scope; did you mean 'score'?
   11 |     p[i] = make_pair((name,-scorer),i);
      |                             ^~~~~~
      |                             score
Language: C++

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

int main(){
  int n,score;
  char name;
  pair<pair<string,int>,int> p[110];
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> name >> score;
    p[i] = make_pair((name,-scorer),i;
  }
  sort(p,p+n);
  for(int i=0; i<n;i++){
    cout << p[i].second+1 <<endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: 'scorer' was not declared in this scope; did you mean 'score'?
   11 |     p[i] = make_pair((name,-scorer),i;
      |                             ^~~~~~
      |                             score
a.cc:11:38: error: expected ')' before ';' token
   11 |     p[i] = make_pair((name,-scorer),i;
      |                     ~                ^
      |                                      )
Language: C++

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

int main(){
  int n;
  pair<pair<string,int>,int> p[110];
  cint >> n;
  for(int i=0; i<n; i++){
    cin >> p[i].first.first >> p[i].first.second >> p[i].second;
  }
  sort(p.p+n);
  for(int i=0; i<n;i++){
    cout << p[i].first.first << p[i].first.second << p[i].second <<endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cint' was not declared in this scope; did you mean 'uint'?
    7 |   cint >> n;
      |   ^~~~
      |   uint
a.cc:11:10: error: request for member 'p' in 'p', which is of non-class type 'std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int> [110]'
   11 |   sort(p.p+n);
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, set<int, less>> rests;
  for (int i = 0; i < n; i++) {
    string s; int r;
    cin >> s >> r;
    rests[s].insert(r);
  }
  for (auto p : rests) {
    for (auto s : p.second) {
      cout << p.first << ' ' << s << endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: type/value mismatch at argument 2 in template parameter list for 'template<class _Key, class _Compare, class _Alloc> class std::set'
    6 |   map<string, set<int, less>> rests;
      |                        ^~~~
a.cc:6:24: note:   expected a type, got 'less'
a.cc:6:28: error: template argument 2 is invalid
    6 |   map<string, set<int, less>> rests;
      |                            ^~
a.cc:6:28: error: template argument 4 is invalid
a.cc:10:10: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   10 |     rests[s].insert(r);
      |          ^
a.cc:12:17: error: 'begin' was not declared in this scope
   12 |   for (auto p : rests) {
      |                 ^~~~~
a.cc:12:17: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/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:12:17: error: 'end' was not declared in this scope
   12 |   for (auto p : rests) {
      |                 ^~~~~
a.cc:12: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: Java

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<Restrant> rests = new ArrayList<>();
    for(int =0;i<N;i++){
      String town = sc.next();
      int num = sc.nextInt();
      rests[i] = new Restrant(town,num,i+1);
    }
    Arrays.sort(rests);
    for(int i=0;i<N;i++){
      System.out.println(rests[i].i);
    }
  }
}

static class Restrant implements Comparable<Restrant>{
  String town;
  int num;
  int id;
  public Restrant(String town,int num,int id){
    this.town=town;
    this.num=num;
    this.id=id;
  }
  @override
  public int compareTo(Restrant r){
    if(this.town.equals(r.town)){
      return r.num - this.num;
    }else{
      return this.town.compareTo(r.town);
    }
  }
}


Compiler output:
Main.java:7: error: not a statement
    for(int =0;i<N;i++){
        ^
Main.java:7: error: ';' expected
    for(int =0;i<N;i++){
           ^
Main.java:7: error: illegal start of expression
    for(int =0;i<N;i++){
            ^
Main.java:7: error: not a statement
    for(int =0;i<N;i++){
                ^
Main.java:7: error: ')' expected
    for(int =0;i<N;i++){
                  ^
Main.java:7: error: ';' expected
    for(int =0;i<N;i++){
                      ^
6 errors
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define pi pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912

const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int GCD(int x,int y){
    return y ? GCD(y,x%y) : x;
}
int N,p;
string s;
vector<pair<pair<string,int>,int>> P;
int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> s >> p;
        P.push_back({{s,-p},i+1});
    }
    sort(P.begin(),P.end());
    for(int i = 0; i < N; i++){
        cout << P.second << endl;;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:55:19: error: 'class std::vector<std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int> >' has no member named 'second'
   55 |         cout << P.second << endl;;
      |                   ^~~~~~
Language: C++

#include <iostream>
#include <cstring>
using namespace std;
int main(){
  int n;
  cin >> n;
  char s[n][15], temp[15];
  int p[n],num[n];
  for(int i=0; i<n; i++){
    cin >> s[i] >> p[i];
    num[n]=n+1;
  }
  for(int i=0; i<n; i++){
    for(int j=n-1; j>i; j++){
      if(s[j]<s[j-1] ||(s[j]==s[j-1]&&p[j]>p[j-1])){
	swap(p[j-1], p[j]);
	swap(num[j-1], num[j]);
	temp=s[j];
	s[j]=s[j-1];
	s[j-1]=temp;
      }
    }
  }
  for(int i=0; i<n; i++)
    cout << num[i] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: invalid array assignment
   18 |         temp=s[j];
      |         ~~~~^~~~~
a.cc:19:13: error: invalid array assignment
   19 |         s[j]=s[j-1];
      |         ~~~~^~~~~~~
a.cc:20:15: error: invalid array assignment
   20 |         s[j-1]=temp;
      |         ~~~~~~^~~~~
Language: C++

#include <iostream>
#include <cstring>
using namespace std;
int main(){
  cin >> int n;
  char s[n][15], temp[15];
  int p[n],num[n];
  for(int i=0; i<n; i++){
    cin >> s[i] >> p[i];
    num[n]=n+1;
  }
  for(int i=0; i<n; i++){
    for(int j=n-1; j>i; j++){
      if(s[j]<s[j-1] ||(s[j]==s[j-1]&&p[j]>p[j-1])){
	swap(p[j-1], p[j]);
	swap(num[j-1], num[j]);
	temp=s[j];
	s[j]=s[j-1];
	s[j-1]=temp;
      }
    }
  }
  for(int i=0; i<n; i++)
    cout << num[i] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   cin >> int n;
      |          ^~~
a.cc:6:10: error: 'n' was not declared in this scope
    6 |   char s[n][15], temp[15];
      |          ^
a.cc:9:12: error: 's' was not declared in this scope
    9 |     cin >> s[i] >> p[i];
      |            ^
a.cc:9:20: error: 'p' was not declared in this scope
    9 |     cin >> s[i] >> p[i];
      |                    ^
a.cc:10:5: error: 'num' was not declared in this scope; did you mean 'enum'?
   10 |     num[n]=n+1;
      |     ^~~
      |     enum
a.cc:14:10: error: 's' was not declared in this scope
   14 |       if(s[j]<s[j-1] ||(s[j]==s[j-1]&&p[j]>p[j-1])){
      |          ^
a.cc:14:39: error: 'p' was not declared in this scope
   14 |       if(s[j]<s[j-1] ||(s[j]==s[j-1]&&p[j]>p[j-1])){
      |                                       ^
a.cc:16:14: error: 'num' was not declared in this scope; did you mean 'enum'?
   16 |         swap(num[j-1], num[j]);
      |              ^~~
      |              enum
a.cc:24:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   24 |     cout << num[i] << endl;
      |             ^~~
      |             enum
Language: C

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

int main() {
    pair<pair<string, int>, int> shop[110];

    int n;
    int buf;
    char bufchar[20];
    string bufstr;

    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> bufchar >> buf;
        bufstr = bufchar;
        shop[i] = make_pair(make_pair(bufstr, -buf), i);
    }

    sort(shop, shop+n);
    for (int i = 0; i < n; i++) {
        cout << shop[i].second + 1 << endl;

    }
}

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

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

int main() {
  int n;
  cin >> n;
  vector<string> vs(n);
  vector<int> p(n);
  for (int i = 0; i < n; i++) {
    cin >> vs[i] >> p[i];
  }
  
  for (int i = 0; i < n; i++) {
    int ans = 1;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      ans += (vs[i] <= vs[j] && p[j] > p[i])++;
    }
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: lvalue required as increment operand
   19 |       ans += (vs[i] <= vs[j] && p[j] > p[i])++;
      |              ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<string> vs(n);
  vector<int> p(n);
  for (int i = 0; i < n; i++) {
    cin >> vs[i] >> p[i];
  }
  
  for (int i = 0; i < n; i++) {
    int ans = 1;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      ans += (vs[i] <= vs[j] && p[j] > p[i])++;
    }
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<string> vs(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:8:16: error: expected primary-expression before '>' token
    8 |   vector<string> vs(n);
      |                ^
a.cc:8:18: error: 'vs' was not declared in this scope
    8 |   vector<string> vs(n);
      |                  ^~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> p(n);
      |          ^~~
a.cc:11:21: error: 'p' was not declared in this scope
   11 |     cin >> vs[i] >> p[i];
      |                     ^
a.cc:18:33: error: 'p' was not declared in this scope
   18 |       ans += (vs[i] <= vs[j] && p[j] > p[i])++;
      |                                 ^
Language: C++

#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <math.h>

using namespace std;


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	vector<pair<string, int>> a;
	vector<pair<string, int>> b;
	for (int i = 0; i < n; i++)
	{
		char s[11];
		int x;
		scanf_s("%10s", s, 11);
		scanf_s("%d", &x);
		a.emplace_back(s, -x);
		b.emplace_back(s, -x);
	}
	sort(a.begin(), a.end());

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (a[i].second == b[j].second)
			{
				cout << j + 1 << '\n';
				break;
			}
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   22 |                 scanf_s("%10s", s, 11);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

struct Info{
  	int seq;
	std::string name;
  	int point;
  	Info(int _s, const std::string& _n, int _p) : seq(_s), name(_n), point(_p) {}; 
};

struct Comp{
	bool operator()(const Info& lhs, const Info& rhs){
    	if(lhs.name == rhs.name) return lhs.point < rhs.point;
      	else return lhs.name < rhs.name;
    }
}

int main(void){
	std::vector<Info> book;
  	int N;
  	std::cin >> N;
  	int i = 1;
  	std::string name;
  	int point;
  	while(N-- > 0){
      	std::cin >> name >> point;
    	book.emplace_back(Info(i++, name, point));
    }
  	std::sort(book.begin(), book.end(), Comp());
  	for(auto iter = book.begin(); iter != book.end(); ++iter){
    	std::cout << iter->seq << std::endl;
    }
  
  	return 0;
}

Compiler output:
a.cc:17:2: error: expected ';' after struct definition
   17 | }
      |  ^
      |  ;
Language: C++

#include <iostream>
#include <vector>

struct Info{
  	int seq;
	std::string name;
  	int point;
  	Info(int _s, const std::string& _n, int _p) : seq(_s), name(_n), point(_p) {}; 
};

struct Comp{
	bool operator()(const Info& lhs, const Info& rhs){
    	if(lhs.name == rhs.name) return lhs.point < rhs.point;
      	else return lhs.name < rhs.name;
    }
}

int main(void){
	std::vector<Info> book;
  	int N;
  	std::cin >> N;
  	int i = 1;
  	std::string name;
  	int point;
  	while(N-- > 0){
      	std::cin >> name >> point;
    	book.emplace_back(Info(i++, name, point));
    }
  	std::sort(book.begin(), book.end(), Comp());
  	for(auto iter = book.begin(); iter != book.end(); ++iter){
    	std::cout << iter->seq << std::endl;
    }
  
  	return 0;
}

Compiler output:
a.cc:16:2: error: expected ';' after struct definition
   16 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:29:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   29 |         std::sort(book.begin(), book.end(), Comp());
      |              ^~~~
      |              qsort
Language: C++

#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
    int N, a, point;
    string b;
    string city;
    cin >> N;
    vector<pair<pair<string, int>, int> >AA;
    for(int i = 0; i < N; i++){
        cin >> b; cin >> a;
        AA.push_back(make_pair(make_pair(b, a*(-1)), i + 1));
    }
	sort(AA.begin(), AA.end());
	for (int i = 0; i < N; i++) cout << AA[i].second <<endl;;
}

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

#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

int n;

char s[101][101];
int val[101];
int index[101];

bool cmp(int x,int y)
{
    if (strcmp(s[x], s[y]) < 0)
        return true;
    else if (strcmp(s[x], s[y]) > 0)
        return false;
    else
    {
        return (val[x] > val[y]);
    }
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        index[i] = i;
        cin >> s[i];
        cin >> val[i];
    }
    sort(index + 1, index + n + 1, cmp);
    for (int i = 1; i <= n; i++)
        cout << index[i] << "\n";
    return 0;
}


Compiler output:
a.cc:11:14: error: 'int index [101]' redeclared as different kind of entity
   11 | int index[101];
      |              ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from a.cc:2:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:30:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   30 |         index[i] = i;
      |              ^
a.cc:34:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   34 |     sort(index + 1, index + n + 1, cmp);
      |          ~~~~~~^~~
a.cc:34:27: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   34 |     sort(index + 1, index + n + 1, cmp);
      |                     ~~~~~~^~~
a.cc:36:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   36 |         cout << index[i] << "\n";
      |                      ^
Language: C++

#include <iostream>
#include <cstring>

using namespace std;

int n;

char s[101][101];
int val[101];
int index[101];

bool cmp(int x,int y)
{
    if (strcmp(s[x], s[y]) < 0)
        return true;
    else if (strcmp(s[x], s[y]) > 0)
        return false;
    else
    {
        return (val[x] > val[y]);
    }
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        index[i] = i;
        cin >> s[i];
        cin >> val[i];
    }
    sort(index + 1, index + n + 1, cmp);
    for (int i = 1; i <= n; i++)
        cout << index[i] << "\n";
    return 0;
}


Compiler output:
a.cc:10:14: error: 'int index [101]' redeclared as different kind of entity
   10 | int index[101];
      |              ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from a.cc:2:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:29:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   29 |         index[i] = i;
      |              ^
a.cc:33:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   33 |     sort(index + 1, index + n + 1, cmp);
      |          ~~~~~~^~~
a.cc:33:27: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   33 |     sort(index + 1, index + n + 1, cmp);
      |                     ~~~~~~^~~
a.cc:33:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   33 |     sort(index + 1, index + n + 1, cmp);
      |     ^~~~
      |     short
a.cc:35:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   35 |         cout << index[i] << "\n";
      |                      ^
Language: C++

#include <iostream>

using namespace std;

int n;

char s[101][101];
int val[101];
int index[101];

bool cmp(int x,int y)
{
    if (strcmp(s[x], s[y]) < 0)
        return true;
    else if (strcmp(s[x], s[y]) > 0)
        return false;
    else
    {
        return (val[x] > val[y]);
    }
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        index[i] = i;
        cin >> s[i];
        cin >> val[i];
    }
    sort(index + 1, index + n + 1, cmp);
    for (int i = 1; i <= n; i++)
        cout << index[i] << "\n";
    return 0;
}


Compiler output:
a.cc:9:5: warning: built-in function 'index' declared as non-function [-Wbuiltin-declaration-mismatch]
    9 | int index[101];
      |     ^~~~~
a.cc: In function 'bool cmp(int, int)':
a.cc:13:9: error: 'strcmp' was not declared in this scope
   13 |     if (strcmp(s[x], s[y]) < 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 | 
a.cc: In function 'int main()':
a.cc:32:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   32 |     sort(index + 1, index + n + 1, cmp);
      |     ^~~~
      |     short
a.cc: In function 'bool cmp(int, int)':
a.cc:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int n;

char s[101][101];
int val[101];
int index[101];

bool cmp(int x,int y)
{
    if (strcmp(s[x], s[y]) < 0)
        return true;
    else if (strcmp(s[x], s[y]) > 0)
        return false;
    else
    {
        return (val[x] > val[y]);
    }
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        index[i] = i;
        cin >> s[i];
        cin >> val[i];
    }
    sort(index + 1, index + n + 1, cmp);
    for (int i = 1; i <= n; i++)
        cout << index[i] << "\n";
    return 0;
}


Compiler output:
a.cc:9:14: error: 'int index [101]' redeclared as different kind of entity
    9 | int index[101];
      |              ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:28:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   28 |         index[i] = i;
      |              ^
a.cc:32:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   32 |     sort(index + 1, index + n + 1, cmp);
      |          ~~~~~~^~~
a.cc:32:27: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   32 |     sort(index + 1, index + n + 1, cmp);
      |                     ~~~~~~^~~
a.cc:34:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   34 |         cout << index[i] << "\n";
      |                      ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

ifstream fin("date.in");

int n;

char s[101][101];
int val[101];
int index[101];

bool cmp(int x,int y)
{
    if (strcmp(s[x], s[y]) < 0)
        return true;
    else if (strcmp(s[x], s[y]) > 0)
        return false;
    else
    {
        return (val[x] > val[y]);
    }
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        index[i] = i;
        cin >> s[i];
        cin >> val[i];
    }
    sort(index + 1, index + n + 1, cmp);
    for (int i = 1; i <= n; i++)
        cout << index[i] << "\n";
    return 0;
}


Compiler output:
a.cc:11:14: error: 'int index [101]' redeclared as different kind of entity
   11 | int index[101];
      |              ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:30:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   30 |         index[i] = i;
      |              ^
a.cc:34:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   34 |     sort(index + 1, index + n + 1, cmp);
      |          ~~~~~~^~~
a.cc:34:27: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   34 |     sort(index + 1, index + n + 1, cmp);
      |                     ~~~~~~^~~
a.cc:36:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   36 |         cout << index[i] << "\n";
      |                      ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

ifstream fin("date.in");

int n;

char s[101][101];
int val[101];
int index[101];

bool cmp(int x,int y)
{
    if (strcmp(s[x], s[y]) < 0)
        return true;
    else if (strcmp(s[x], s[y]) > 0)
        return false;
    else
    {
        return (val[x] > val[y]);
    }
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        index[i] = i;
        cin >> s[i];
        cin >> val[i];
    }
    sort(index + 1, index + n + 1, cmp);
    for (int i = 1; i <= n; i++)
        cout << index[i] << " ";
    return 0;
}


Compiler output:
a.cc:11:14: error: 'int index [101]' redeclared as different kind of entity
   11 | int index[101];
      |              ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:30:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   30 |         index[i] = i;
      |              ^
a.cc:34:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   34 |     sort(index + 1, index + n + 1, cmp);
      |          ~~~~~~^~~
a.cc:34:27: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   34 |     sort(index + 1, index + n + 1, cmp);
      |                     ~~~~~~^~~
a.cc:36:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   36 |         cout << index[i] << " ";
      |                      ^
Language: C++

#include <iostream>
#include <vector>
#include <tuple>
#include <string>

using namespace std;

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

    for (int i = 1; i <= n; i++){
        string s;
        int p;
        cin >> s >> p;
        p = -p;
        a.push_back(tie(s, p, i));
    }

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

    for (int i = 0; i < n; i++){
        cout << get<2>(a[i]) << endl;
    }

    for (int i = 0; i < n; i++){
        string s;
        int p;
        int id;
        tie(s, p, id) = a[i];
        cout << id << endl;
    }
}

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

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


char name[120];
pair<pair<string,int>,int> p[110];
int main(){
    int N;
    cin>>N;
    for(int i = 0; i<N;i++){
        int num;
        cin>>name>>num;
        string tmp = name;
        p[i]=make_pair(make_pair(tmp,-num),i);

    }
    sort(p,p+N);
    for(int i = 0 ; i<N;i++){
        cout<<p[i].second+1<<endl;
    }

    

Compiler output:
a.cc: In function 'int main()':
a.cc:20:6: error: expected '}' at end of input
   20 |     }
      |      ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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

using namespace std;

int main()
{  
    int N;
    cin >> N;
    vector<pair<string,pair<int, int>>> R(N);
    for(int i = 0; i < N; i++){
        cin >> R[i].first >> R[i].second.first;
        R[i].second.second = i + 1;
        R[i].second.first = R[i].second.first*-1
    }
    sort(R.begin(), R.end());

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:49: error: expected ';' before '}' token
   18 |         R[i].second.first = R[i].second.first*-1
      |                                                 ^
      |                                                 ;
   19 |     }
      |     ~
Language: C++

#include "pch.h"
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
pair<string, pair<int,int>> a[101];
bool comp(pair<string, pair<int, int>> x, pair<string, pair<int, int>> y) {
	if (x.first == y.first) {
		return x.second.first > y.second.first;
	}
	return x.first < y.first;
}
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i].first >> a[i].second.first;
		a[i].second.second = i + 1;
	}
	sort(a, a + n, comp);
	for (int i = 0; i < n; i++) {
		cout << a[i].second.second << '\n';
	}



}
// 335


Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: Java

import java.util.*;
 
class Restaurant{
  int id;
  String name;
  int point;
  
  Restaurant(int i, String s, int p){
    id = i;
    name = s;
    point = p;
  }
  @Override
  public int compare(Restaurant r1, Restaurant r2) {
		int n;
    	n = -r1.name.compareTo(r2.name);
    	if (n == 0) n = (r1.point < r2.point) ? -1: 1;
    	return n;
  }
}
 
public class Main{
  public static void main(String[] args){
    ArrayList<Restaurant> r = new ArrayList<>();
    int n;
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    for(int i = 0; i < n; i ++){
      String s = sc.next();
      int p = sc.nextInt();
      Restaurant re = new Restaurant(i+1, s,p);
      r.add(re);
    }
    Collections.sort(r);
    for(int i = n-1; i >= 0; i --){
      System.out.print(r.get(i).id);
      if (i != 0)SYstem.out.println();
    }
  }
}

Compiler output:
Main.java:13: error: method does not override or implement a method from a supertype
  @Override
  ^
Main.java:34: error: no suitable method found for sort(ArrayList<Restaurant>)
    Collections.sort(r);
               ^
    method Collections.<T#1>sort(List<T#1>) is not applicable
      (inference variable T#1 has incompatible bounds
        equality constraints: Restaurant
        upper bounds: Comparable<? super T#1>)
    method Collections.<T#2>sort(List<T#2>,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Comparable<? super T#1> declared in method <T#1>sort(List<T#1>)
    T#2 extends Object declared in method <T#2>sort(List<T#2>,Comparator<? super T#2>)
Main.java:37: error: package SYstem does not exist
      if (i != 0)SYstem.out.println();
                       ^
3 errors
Language: Java

import java.util.*;
 
class Restaurant{
  int id;
  String name;
  int point;
  
  Restaurant(int i, String s, int p){
    id = i;
    name = s;
    point = p;
  }
  @Override
  public int compare(Restaurant r1, Restaurant r2) {
		int n;
    	n = -r1.name.compare(r2.name);
    	if (n == 0) n = (r1.point < r2.point) ? -1: 1;
    	return n;
  }
}
 
public class Main{
  public static void main(String[] args){
    ArrayList<Restaurant> r = new ArrayList<>();
    int n;
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    for(int i = 0; i < n; i ++){
      String s = sc.next();
      int p = sc.nextInt();
      Restaurant re = new Restaurant(i+1, s,p);
      r.add(re);
    }
    Collections.sort(r);
    for(int i = n-1; i >= 0; i --){
      System.out.print(r.get(i).id);
      if (i != 0)SYstem.out.println();
    }
  }
}

Compiler output:
Main.java:13: error: method does not override or implement a method from a supertype
  @Override
  ^
Main.java:16: error: cannot find symbol
    	n = -r1.name.compare(r2.name);
    	            ^
  symbol:   method compare(String)
  location: variable name of type String
Main.java:34: error: no suitable method found for sort(ArrayList<Restaurant>)
    Collections.sort(r);
               ^
    method Collections.<T#1>sort(List<T#1>) is not applicable
      (inference variable T#1 has incompatible bounds
        equality constraints: Restaurant
        upper bounds: Comparable<? super T#1>)
    method Collections.<T#2>sort(List<T#2>,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Comparable<? super T#1> declared in method <T#1>sort(List<T#1>)
    T#2 extends Object declared in method <T#2>sort(List<T#2>,Comparator<? super T#2>)
Main.java:37: error: package SYstem does not exist
      if (i != 0)SYstem.out.println();
                       ^
4 errors
Language: Java

import java.util.*;

class Restaurant{
  int id;
  String name;
  int point;
  
  Restaurant(int i, String s, int p){
    id = i;
    name = s;
    point = p;
  }
  @Override
  public int compare(Restaurant r1, Restaurant r2) {
		int n;
    	n = -r1.name.compare(r2.name);
    	if (n == 0) n = (r1.point < r2.point) ? -1: 1;
    	return n;
  }
}

public class Main{
  public static void main(String[] args){
    ArrayList<Restaurant> r = new ArrayList<>();
    int n;
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    for(int i = 0; i < n; i ++){
      String s = sc.next();
      int p = sc.nextInt();
      Restaurant re(i+1, s,p);
      r.add(re);
    }
    Collections.sort(r);
    for(int i = n-1; i >= 0; i --){
      SYstem.out.print(r.get(i).id);
      if (i != 0)SYstem.out.println();
    }
  }
}

Compiler output:
Main.java:31: error: ';' expected
      Restaurant re(i+1, s,p);
                   ^
Main.java:31: error: not a statement
      Restaurant re(i+1, s,p);
                     ^
Main.java:31: error: ';' expected
      Restaurant re(i+1, s,p);
                       ^
Main.java:31: error: not a statement
      Restaurant re(i+1, s,p);
                         ^
Main.java:31: error: ';' expected
      Restaurant re(i+1, s,p);
                          ^
Main.java:31: error: not a statement
      Restaurant re(i+1, s,p);
                           ^
Main.java:31: error: ';' expected
      Restaurant re(i+1, s,p);
                            ^
7 errors
Language: C++

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

int main(void){
  
  int N;
  cin >> N;
  
  typedef pair<string,int> P;
  typedef pair<P,int> data;
  vector<data> v;
  
  string S;
  int p;
  
  for(int i = 0; i < N; ++i){
    cin >> S >> p;
    v.push_back(data(P(S,p),i+1));
  }
  
  sort(v.begin(),v.end());
  
  for(int i = 0; i < N; ++i){
    cout << v[i].second <<endl;
  }
  
  return 0;
}


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

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

int main(void){
  
  int N;
  cin >> N;
  
  typedef pair<string,int> P;
  typedef pair<P,int> data;
  vector<data> v;
  
  String S;
  int p;
  
  for(int i = 0; i < N; ++i){
    cin >> S >> p;
    v.push_back(data(P(S,p),i+1));
  }
  
  sort(v.begin(),v.end());
  
  for(int i = 0; i < N; ++i){
    cout << v[i].second <<endl;
  }
  
  return 0;
}


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

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

int main(void){
  
  int N;
  cin >> N;
  
  typedef pair<string,int> P;
  typedef pair<P,int> data;
  vector<data> v;
  
  String S;
  int p;
  
  for(int i = 0; i < N; ++i){
    cin >> S >> p;
    v.push_back(data(P(S,p),i+1));
  }
  
  sort(v.begin(),v.end());
  
  for(int i = 0; i < N; ++i){
    cout << v[i].second <<endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'vector' was not declared in this scope
   13 |   vector<data> v;
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <utility>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:13:14: error: expected primary-expression before '>' token
   13 |   vector<data> v;
      |              ^
a.cc:13:16: error: 'v' was not declared in this scope
   13 |   vector<data> v;
      |                ^
a.cc:15:3: error: 'String' was not declared in this scope
   15 |   String S;
      |   ^~~~~~
a.cc:19:12: error: 'S' was not declared in this scope
   19 |     cin >> S >> p;
      |            ^
a.cc:23:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   23 |   sort(v.begin(),v.end());
      |   ^~~~
      |   short