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

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7
const double c_PI = 3.14159265358979323846264338327950288;



char S[200];
pair<pair<string, int>, int> info[1000];

int main() {
	int N;
	scanf("%d", &N);


	for (int i = 0; i < N; i++) {
		int P;
		scanf("%s%d", S, &P);
		string temp = S;
		info[i] = make_pair(make_pair(S, -P), i);
	}

	sort(info, info + N);

	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].second + 1);
	}






}




Compiler output:
a.cc:22:11: error: 'string' was not declared in this scope
   22 | pair<pair<string, int>, int> info[1000];
      |           ^~~~~~
a.cc:7:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    6 | #include <algorithm>
  +++ |+#include <string>
    7 | using namespace std;
a.cc:22:22: error: template argument 1 is invalid
   22 | pair<pair<string, int>, int> info[1000];
      |                      ^
a.cc:22:28: error: template argument 1 is invalid
   22 | pair<pair<string, int>, int> info[1000];
      |                            ^
a.cc: In function 'int main()':
a.cc:32:17: error: 'string' was not declared in this scope
   32 |                 string temp = S;
      |                 ^~~~~~
a.cc:32:17: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:33:36: error: cannot convert 'std::pair<std::pair<char*, int>, int>' to 'int' in assignment
   33 |                 info[i] = make_pair(make_pair(S, -P), i);
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                                    |
      |                                    std::pair<std::pair<char*, int>, int>
a.cc:39:40: error: request for member 'second' in 'info[i]', which is of non-class type 'int'
   39 |                 printf("%d\n", info[i].second + 1);
      |                                        ^~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7
const double c_PI = 3.14159265358979323846264338327950288;

int main() {
	int N, P;
	char S[200];
	scanf("%d", &N);

	pair<pair<string, int>, int> info[1000];

	for (int i = 0; i < N; i++) {
		scanf("%s%d", S, &P);
		string temp = S;
		info[i] = make_pair(make_pair(S, -P), i);
	}

	sort(info, info + N);

	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].second + 1);
	}






}




Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'string' was not declared in this scope
   24 |         pair<pair<string, int>, int> info[1000];
      |                   ^~~~~~
a.cc:7:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    6 | #include <algorithm>
  +++ |+#include <string>
    7 | using namespace std;
a.cc:24:30: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                              ^
a.cc:24:36: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                                    ^
a.cc:28:23: error: expected ';' before 'temp'
   28 |                 string temp = S;
      |                       ^~~~~
      |                       ;
a.cc:29:36: error: cannot convert 'std::pair<std::pair<char*, int>, int>' to 'int' in assignment
   29 |                 info[i] = make_pair(make_pair(S, -P), i);
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                                    |
      |                                    std::pair<std::pair<char*, int>, int>
a.cc:35:40: error: request for member 'second' in 'info[i]', which is of non-class type 'int'
   35 |                 printf("%d\n", info[i].second + 1);
      |                                        ^~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7
const double c_PI = 3.14159265358979323846264338327950288;

int main() {
	int N, P;
	char S[200];
	scanf("%d", &N);

	pair<pair<string, int>, int> info[1000];

	for (int i = 0; i < N; i++) {
		scanf("%s%d", S, &P);
		info[i] = make_pair(make_pair(S, -P), i);
	}

	sort(info, info + N);

	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].second + 1);
	}






}




Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'string' was not declared in this scope
   24 |         pair<pair<string, int>, int> info[1000];
      |                   ^~~~~~
a.cc:7:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    6 | #include <algorithm>
  +++ |+#include <string>
    7 | using namespace std;
a.cc:24:30: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                              ^
a.cc:24:36: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                                    ^
a.cc:28:36: error: cannot convert 'std::pair<std::pair<char*, int>, int>' to 'int' in assignment
   28 |                 info[i] = make_pair(make_pair(S, -P), i);
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                                    |
      |                                    std::pair<std::pair<char*, int>, int>
a.cc:34:40: error: request for member 'second' in 'info[i]', which is of non-class type 'int'
   34 |                 printf("%d\n", info[i].second + 1);
      |                                        ^~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7
const double c_PI = 3.14159265358979323846264338327950288;

int main() {
	int N, P[100005];
	char S[200];
	scanf("%d", &N);

	pair<pair<string, int>, int> info[1000];

	for (int i = 0; i < N; i++) {
		scanf("%s%d", S, &P[i]);
		info[i] = make_pair(make_pair(S, -P[i]), i);
	}

	sort(info, info + N);

	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].second + 1);
	}






}




Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'string' was not declared in this scope
   24 |         pair<pair<string, int>, int> info[1000];
      |                   ^~~~~~
a.cc:7:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    6 | #include <algorithm>
  +++ |+#include <string>
    7 | using namespace std;
a.cc:24:30: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                              ^
a.cc:24:36: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                                    ^
a.cc:28:36: error: cannot convert 'std::pair<std::pair<char*, int>, int>' to 'int' in assignment
   28 |                 info[i] = make_pair(make_pair(S, -P[i]), i);
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                                    |
      |                                    std::pair<std::pair<char*, int>, int>
a.cc:34:40: error: request for member 'second' in 'info[i]', which is of non-class type 'int'
   34 |                 printf("%d\n", info[i].second + 1);
      |                                        ^~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7
const double c_PI = 3.14159265358979323846264338327950288;

int main() {
	int N, P[100005];
	string S;
	scanf("%d", &N);

	pair<pair<string, int>, int> info[1000];

	for (int i = 0; i < N; i++) {
		scanf("%s%d", S, &P[i]);

		info[i] = make_pair(make_pair(S, -P[i]), i);
	}

	sort(info, info + N);

	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].second + 1);
	}






}




Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'string' was not declared in this scope
   21 |         string S;
      |         ^~~~~~
a.cc:7:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    6 | #include <algorithm>
  +++ |+#include <string>
    7 | using namespace std;
a.cc:24:36: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                                    ^
a.cc:27:31: error: 'S' was not declared in this scope
   27 |                 scanf("%s%d", S, &P[i]);
      |                               ^
a.cc:35:40: error: request for member 'second' in 'info[i]', which is of non-class type 'int'
   35 |                 printf("%d\n", info[i].second + 1);
      |                                        ^~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7
const double c_PI = 3.14159265358979323846264338327950288;

int main() {
	int N, P[100005];
	char S[200][200];
	scanf("%d", &N);

	pair<pair<string, int>, int> info[1000];

	for (int i = 0; i < N; i++) {
		scanf("%s%d", S[i], &P[i]);

		info[i] = make_pair(make_pair(S[i], -P[i]), i);
	}

	sort(info, info + N);

	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].second + 1);
	}






}




Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'string' was not declared in this scope
   24 |         pair<pair<string, int>, int> info[1000];
      |                   ^~~~~~
a.cc:7:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    6 | #include <algorithm>
  +++ |+#include <string>
    7 | using namespace std;
a.cc:24:30: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                              ^
a.cc:24:36: error: template argument 1 is invalid
   24 |         pair<pair<string, int>, int> info[1000];
      |                                    ^
a.cc:29:36: error: cannot convert 'std::pair<std::pair<char*, int>, int>' to 'int' in assignment
   29 |                 info[i] = make_pair(make_pair(S[i], -P[i]), i);
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                    |
      |                                    std::pair<std::pair<char*, int>, int>
a.cc:35:40: error: request for member 'second' in 'info[i]', which is of non-class type 'int'
   35 |                 printf("%d\n", info[i].second + 1);
      |                                        ^~~~~~
Language: C++

#include <iostream>
#include <utility>

using namespace std;

int N;
string a_str;
int a_int;

pair<pair<string,int>,int> arr[105];

bool compareDirectly (const pair<pair<string,int>,int> p1, const pair<pair<string,int>,int> p2) {
    if (p1.first.first < p2.first.first) {
        return true;
    } else if (p1.first.first > p2.first.first) {
        return false;
    } else {
        if (p1.first.second > p2.first.second){
            return true;
        } else {
            return false;
        }
    
    }
        
}



int main () {

    cin >> N;

    for (int i = 0; i < N ; i++){
        cin >> a_str >> a_int;

        arr[i] = make_pair(make_pair(a_str,a_int),i);
    }

    sort(arr,arr+N, compareDirectly);

    cout << "Print!" << "\n" ;
    for ( int j = 0 ; j< N; j++){
        cout << arr[j].second+1 << "\n"; 
    }
  return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

int N;
string a_str;
int a_int;

pair<pair<string,int>,int> arr[105];

bool compareDirectly (const pair<pair<string,int>,int> p1, const pair<pair<string,int>,int> p2) {
    if (p1.first.first < p2.first.first) {
        return true;
    } else if (p1.first.first > p2.first.first) {
        return false;
    } else {
        if (p1.first.second > p2.first.second){
            return true;
        } else {
            return false;
        }
    
    }
        
}



int main () {

    cin >> N;

    for (int i = 0; i < N ; i++){
        cin >> a_str >> a_int;

        arr[i] = make_pair(make_pair(a_str,a_int),i);
    }

    sort(arr,arr+N, compareDirectly);

    cout << "Print!" << "\n" ;
    for ( int j = 0 ; j< N; j++){
        cout << arr[j].second+1 << "\n"; 
    }
  return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:11: error: expected ';' before '}' token
   45 |   return 0
      |           ^
      |           ;
   46 | }
      | ~
Language: Java

t java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int n = sc.nextInt();

		int[] num = new int[n+1];
		String[] s = new String[n+1];
		int[] p = new int[n+1];

		for(int i=0; i<n; i++) {
			num[i] = i+1;
			s[i] = sc.next();
			p[i] = sc.nextInt();
		}

		num[n]=0;
		s[n]="0";
		p[n]=0;

		/* 辞書順にソート */
		for(int j=n; 0<j; j--) {
			for(int k=0; k<j; k++) {
				if(s[k].compareToIgnoreCase(s[k+1]) > 0) {
					num[n] = num[k];
					s[n] = s[k];
					p[n] = p[k];

					num[k] = num[k+1];
					s[k] = s[k+1];
					p[k] = p[k+1];

					num[k+1] = num[n];
					s[k+1] = s[n];
					p[k+1] = p[n];
					/* P順にソート */
				}if(s[k].compareToIgnoreCase(s[k+1]) == 0) {
					if(p[k]<p[k+1]) {
						num[n] = num[k];
						s[n] = s[k];
						p[n] = p[k];

						num[k] = num[k+1];
						s[k] = s[k+1];
						p[k] = p[k+1];

						num[k+1] = num[n];
						s[k+1] = s[n];
						p[k+1] = p[n];
					}
				}
			}
		}

		for(int i=0; i<n; i++) {
			System.out.println(num[i]);
		}
	}
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
t java.util.Scanner;
^
1 error
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<tuple<string,int,int>> a(n);
  for(int i=0;i<n;i++){
    string a;
    cin>>a;
    int s;
    int g=100-s;
    cin>>s;
    int j=i+1;
    a[i]=make_tuple(a,g,j);
  }
  sort(a.begin(),a.end());
  for(int i=0;i<n;i++){
    int w;
    tie(ignore,ignore,w)=a[i];
    cout<<w<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: cannot convert 'std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int>' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   15 |     a[i]=make_tuple(a,g,j);
      |          ~~~~~~~~~~^~~~~~~
      |                    |
      |                    std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int>
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<tuple<string,int,int>> a(n);
  for(int i=0;i<n;i++){
    string a;
    cin>>a;
    int s;
    cin>>s;
    tie(a,100-s,i+1)=a[i];
  }
  sort(a.begin(),a.end());
  for(int i=0;i<n;i++){
    int w;
    tie(ignore,ignore,w)=a[i];
    cout<<w<<endl;
  }
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
   13 |     tie(a,100-s,i+1)=a[i];
      |           ~~~^~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/tuple:2791:19: note:   initializing argument 2 of 'constexpr std::tuple<_Elements& ...> std::tie(_Elements& ...) [with _Elements = {__cxx11::basic_string<char, char_traits<char>, allocator<char> >, int, int}]'
 2791 |     tie(_Elements&... __args) noexcept
      |         ~~~~~~~~~~^~~~~~~~~~
Language: C++

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

int main(){
  int N; cin>>N;
  pair<pair<string,int>,int> p[N];

  for(int i=0;i<N;i++){
    string s; int tmp; cin >>s>>tmp;
    p[i]=make_pair(make_pair(s,-tmp),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:15:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   15 |   sort(p,p+N);
      |   ^~~~
      |   sqrt
Language: C++

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

using namespace std;

bool compare(tuple<int, string, int>& a, tuple<int, string, int>& b) {
    if (get<1>(a) != get<1>(b))
        return get<1>(a) < get<1>(b);
    else
        return get<2>(a) > get<2>(b);
}

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

    vector<tuple<int, string, int>> v(n);
    for (int i = 0; i < n; ++i) {
        string s;
        int p;
        cin >> s >> p;
        v[i] = make_tuple(i, s, p);
    }

    sort(v.begin(), v.end(), compare);

    for (int i = 0; i < n; ++i)
        cout << get<0>(v[i]) + 1 << '\n';
}


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

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

int main() {
    int  num_of_tuple = 0;
    cin >> num_of_tuple;
   
    string a;
    int b = 0;
    
    vector<tuple<string, int, int>> v(num_of_tuple);

    for (int i = 0; i < num_of_tuple; ++i) {
        cin >> a >> b;
        v.at(i) = make_tuple(a, b, 1+i); //3番目の要素にインデックスの代わりを入れる
    }
    
    //市名順にソート
    //sort(v.begin(), v.end());
    sort(v.begin(), v.end(), const tuple<string, int, int>& t1, const tuple<string, int, int>& t2){
        if(get<0>(t1) != get<0>(t2)){
            return get<0>(t1) < get<0>(t2);
        } else {
            get<1>(t1) > get<1>(t2);
        }
    });
    
    
    
    //ソートしたものを出力
    for (tuple<string, int, int> i : v) {
        string s;
        int x=0,y=0;
        tie(s,x,y) = i;
        //cout << s << " " << x << " " << y << endl; //入っている要素を確かめるためのcout
        cout << y << endl;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: expected primary-expression before 'const'
   20 |     sort(v.begin(), v.end(), const tuple<string, int, int>& t1, const tuple<string, int, int>& t2){
      |                              ^~~~~
a.cc:20:50: error: expected primary-expression before 'int'
   20 |     sort(v.begin(), v.end(), const tuple<string, int, int>& t1, const tuple<string, int, int>& t2){
      |                                                  ^~~
a.cc:20:55: error: expected primary-expression before 'int'
   20 |     sort(v.begin(), v.end(), const tuple<string, int, int>& t1, const tuple<string, int, int>& t2){
      |                                                       ^~~
a.cc:20:65: error: expected primary-expression before 'const'
   20 |     sort(v.begin(), v.end(), const tuple<string, int, int>& t1, const tuple<string, int, int>& t2){
      |                                                                 ^~~~~
a.cc:20:85: error: expected primary-expression before 'int'
   20 |     sort(v.begin(), v.end(), const tuple<string, int, int>& t1, const tuple<string, int, int>& t2){
      |                                                                                     ^~~
a.cc:20:90: error: expected primary-expression before 'int'
   20 |     sort(v.begin(), v.end(), const tuple<string, int, int>& t1, const tuple<string, int, int>& t2){
      |                                                                                          ^~~
a.cc:26:6: error: expected primary-expression before ')' token
   26 |     });
      |      ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> P(N);
  vector<string> S(N), T(N), U(N);
  rep(i, N) cin >> S.at(i) >> P.at(i);
  rep(i, N) T.at(i)=S.at(i)+to_string(999-P.at(i));
  rep(i, N) U.at(i)=T.at(i);
  sort(T.begin(), T.end());
  rep(i, N){
    rep(j, N){
      if(T.at(i)==U.at(j)) cout << j+1 << endl;
    }
  }
}de <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int N;
  cin >> N;
  vector<int> P(N);
  vector<string> S(N), T(N), U(N);
  rep(i, N) cin >> S.at(i) >> P.at(i);
  rep(i, N) T.at(i)=S.at(i)+to_string(999-P.at(i));
  rep(i, N) U.at(i)=T.at(i);
  sort(T.begin(), T.end());
  rep(i, N){
    rep(j, N){
      if(T.at(i)==U.at(j)) cout << j+1 << endl;
    }
  }
}

Compiler output:
a.cc:19:2: error: 'de' does not name a type
   19 | }de <bits/stdc++.h>
      |  ^~
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

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

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

#include<iostream>
#include<stdio.h>
#include<vector>
#include<stdlib.h>
#include<algorithm>
#include<string>
#include<string.h>
#include<queue>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<pair<string,int> > a(n);
  for(int i=0;i<n;i++){
    cin >> a[i].first >> a[i].second;
    a[i].second=100-a[i].second;
    a[i].second=a[i].second*1000+i;
  }
  sort(a.begin(),a.end());
  for(int i=0;i<n;i++){
    cout << a[i].second%1000 +1 << endl;
  }
  return 0;
}

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

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

int main () {
  int n; 
  cin >> n;
  vector<pair<pair<string,int>,int>> a(n);
    rep(i,n) {
    cin >> a.at(i).first.first >> a.at(i).first.second;
      a.second = i+1;
    a.at(i).second *= -1;
  }
  sort(a.begin(),a.end());
  rep(i,n) {
    cout << a.at(i).second << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'class std::vector<std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int> >' has no member named 'second'
   11 |       a.second = i+1;
      |         ^~~~~~
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:5:13: note: to match this '{'
    5 | int main () {
      |             ^
Language: C++

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

int main () {
  int n; 
  cin >> n;
  vectorpair<<pair<string,int>,int>> a(n);
    rep(i,n) {
    cin >> a.at(i).first.first >> a.at(i).first.second;
      a.second = i+1;
    a.at(i).second *= -1;
  }
  sort(a.begin(),a.end());
  rep(i,n) {
    cout << a.at(i).second << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vectorpair' was not declared in this scope
    8 |   vectorpair<<pair<string,int>,int>> a(n);
      |   ^~~~~~~~~~
a.cc:8:31: error: expected primary-expression before ',' token
    8 |   vectorpair<<pair<string,int>,int>> a(n);
      |                               ^
a.cc:8:32: error: expected primary-expression before 'int'
    8 |   vectorpair<<pair<string,int>,int>> a(n);
      |                                ^~~
a.cc:10:12: error: 'a' was not declared in this scope
   10 |     cin >> a.at(i).first.first >> a.at(i).first.second;
      |            ^
a.cc:14:8: error: 'a' was not declared in this scope
   14 |   sort(a.begin(),a.end());
      |        ^
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:5:13: note: to match this '{'
    5 | int main () {
      |             ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
static const int MAX=100;

typedef struct restaurant{
    char city;
    int score;
    int num;
}R;

//文字列のソートをinsert sortで行う
void sort_R(R A[MAX], int n){
    for(int i=0; i<n; i++){
        char v = A[i].city;
        int sc = A[i].score;
        int j = i-1;
        while(j>=0 && A[j].city >= v){
            if(A[j].city == v){
                if(A[j].score > sc){
                    A[j+1] = A[j];
                }
            }
            else A[j+1] = A[j];
            j--;
        }
        A[j+1].city = v;
        A[j+1].score = sc;
    }
}

int main(void){
    int n;
    R res[MAX];
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> res[i].city >> res[i].score;
        res[i].num = i+1; 
    }
    sort_R(res);
    for(int i=0; i<n; i++){
        cout << res[i].num << "\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:11: error: too few arguments to function 'void sort_R(R*, int)'
   40 |     sort_R(res);
      |     ~~~~~~^~~~~
a.cc:13:6: note: declared here
   13 | void sort_R(R A[MAX], int n){
      |      ^~~~~~
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
static const int MAX=100;

typedef struct restaurant{
    char city;
    int score;
    int num;
}R;

//文字列のソートをinsert sortで行う
void sort_R(R A[MAX], int n){
    for(int i=0; i<n; i++){
        char v = A[i].city;
        int sc = A[i].score;
        int j = i-1;
        while(j>=0 && A[j].city >= v){
            if(A[j].city == v){
                if(A[j].score > sc){
                    A[j+1] = A[j];
                }
            }
            else A[j+1] = A[j];
            j--;
        }
        A[j+1].city = v;
        A[j+1].score = sc;
    }
}

int main(void){
    int n;
    R res[MAX];
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> res[i].city >> score[i].score;
        res[i].num = i+1; 
    }
    sort_R(res);
    for(int i=0; i<n; i++){
        cout << res[i].num << "\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:31: error: 'score' was not declared in this scope
   37 |         cin >> res[i].city >> score[i].score;
      |                               ^~~~~
a.cc:40:11: error: too few arguments to function 'void sort_R(R*, int)'
   40 |     sort_R(res);
      |     ~~~~~~^~~~~
a.cc:13:6: note: declared here
   13 | void sort_R(R A[MAX], int n){
      |      ^~~~~~
Language: C++

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

int mein(){
    int N,P;
    cin>>N;
    string s;
    pair<pair<string,int>,int> p[110];

    for(int i=0;i<N;i++){
        cin>>s>>P;
        p[i]=make_pair(make_pair(s,P),i);
    }
    sort(p,p+N);

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

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int mein(){
    int N,P;
    cin>>N;
    string s;
    pair<pair<string,int>,int> p[110];

    for(int i=0;i<N;i++){
        cin>>s>>P;
        p[i]=make_pair(make_pair(s,P),i);
    }
    sort(p,p+N);

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

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int mein(){
    int n;
    pair<pair<string,int>,int> g[100];
    cin>>n;
    for(int i=0;i<n;i++){
        int t;
        string s;
        cin>>s>>t;
        g[i]=make_pair(make_pair(s,t),i+1);
    }
    sort(g,g+n);
    for(int i=0;i<n;i++){
        cout<<g[i].second<<endl;
    }
    return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int mein(){
    int n;
    pair<pair<string,int>,int> g[100];
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>g[i].first.first>>g[i].first.second;
        g[i].first.second*=-1;
        g[i].second=i+1;
    }
    sort(g,g+n);
    for(int i=0;i<n;i++){
        cout<<g[i].second<<endl;
    }
    return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>

using namespace std;

bool mycompare( tuple<string,int,int> &lhs, tuple<string,int,int> &rhs )
{
    if (get<0>(lhs) != get<0>(rhs)) return get<0>(lhs) < get<0>(rhs);
    if (get<1>(lhs) != get<1>(rhs)) return get<1>(lhs) > get<1>(rhs);
    return get<2>(lhs) < get<2>(rhs);
}

int main(){
    int n,i; cin >> n;
    string s[n];int p[n];
    tuple<string,int,int> t[n];
    for(i = 0; i < n; i++){
        cin >> s[i] >> p[i];
        t[i] = make_tuple(s[i],p[i],i+1);
    }
    sort(t,t+n,mycompare);
    for(i = 0;i < n; i++){
        cout << get<2>(t[i]) << endl;
    }
    return 0;
}

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

#include<iostream>

using namespace std;

bool mycompare( const tuple<string,int,int> &lhs, const tuple<string,int,int> &rhs )
{
    if (get<0>(lhs) != get<0>(rhs)) return get<0>(lhs) < get<0>(rhs);
    if (get<1>(lhs) != get<1>(rhs)) return get<1>(lhs) > get<1>(rhs);
    return get<2>(lhs) < get<2>(rhs);
}

int main(){
    int n,i; cin >> n;
    string s[n];int p[n];
    tuple<string,int,int> t[n];
    for(i = 0; i < n; i++){
        cin >> s[i] >> p[i];
        t[i] = make_tuple(s[i],p[i],i+1);
    }
    sort(t,t+n,mycompare);
    for(i = 0;i < n; i++){
        cout << get<2>(t[i]) << endl;
    }
    return 0;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
int main()
{
    int N;
    std::cin >> N;

    std::vector<std::pair<std::pair<std::string, int>, int>> r;
    std::string s;
    int p;
    for (int i = 0; i < N; i++) {
        std::cin >> s;
        std::cin >> p;
        r.push_back(std::make_pair(std::make_pair(s, -p), i+1);
    }

    std::sort(std::begin(r), std::end(r));

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:63: error: expected ')' before ';' token
   16 |         r.push_back(std::make_pair(std::make_pair(s, -p), i+1);
      |                    ~                                          ^
      |                                                               )
Language: C

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

int main() {
    pair<pair<string, int>, int> p[100];
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int q;
        cin >> p[i].first.first >> q;
        p[i].first.second = -q;
        p[i].second = i+1;
    }

    sort(p, p+n);

    for (int i = 0; i < n; i++) {
        cout << p[i].second << endl;
    }
    return 0;
}

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

import java.util.*;
class Restraunt{
  private int id ;
  private String name ;
  private int score ;

  Restraunt(int id,String name,int score){
    this.id = id;
    this.name = name;
    this.score = score;
  }
  public int idget(){
    return this.id;
  }
  public String nameget(){
    return this.name;
  }
  public int scoreget(){
    return this.score;
  }
}

class Judge implements Comparator<Restraunt>{
  public int compare(Restraunt r1, Restraunt r2){
    int nam = r1.nameget().compareTo(r2.nameget());
    if(nam == 0){
      nam = Integer.valueOf(r1.scoreget()).compareTo(Integer.valueOf(r2.scoreget()));
    }
    return nam;
  }
}

public class Main{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();



    List<Restraunt> list = new ArrayList<Restraunt>();
    for(int i=0; i<n; i++){
      Restraunt r = new Restraunt(Integer.valueOf(i+1).intValue(),sc.next(),Integer.valueOf(sc.next()).intValue());
      list.add(r);
    }
    //for(Restraunt restraunt:list){
      //System.out.println("id:"+restraunt.idget()+" name:"+restraunt.nameget()+" score:"+restraunt.scoreget());
    //}
    Collections.sort(list,new Judge());
    for(Restraunt restraunt:list){
      System.out.println(restraunt.idget());
    }

Compiler output:
Main.java:52: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.*;
class Main{
  private int id ;
  private String name ;
  private int score ;

  Restraunt(int id,String name,int score){
    this.id = id;
    this.name = name;
    this.score = score;
  }
  public int idget(){
    return this.id;
  }
  public String nameget(){
    return this.name;
  }
  public int scoreget(){
    return this.score;
  }
}

class Judge implements Comparator<Restraunt>{
  public int compare(Restraunt r1, Restraunt r2){
    int nam = r1.nameget().compareTo(r2.nameget());
    if(nam == 0){
      nam = Integer.valueOf(r1.scoreget()).compareTo(Integer.valueOf(r2.scoreget()));
    }
    return nam;
  }
}

public class Guidebook{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();



    List<Restraunt> list = new ArrayList<Restraunt>();
    for(int i=0; i<n; i++){
      Restraunt r = new Restraunt(Integer.valueOf(i+1).intValue(),sc.next(),Integer.valueOf(sc.next()).intValue());
      list.add(r);
    }
    //for(Restraunt restraunt:list){
      //System.out.println("id:"+restraunt.idget()+" name:"+restraunt.nameget()+" score:"+restraunt.scoreget());
    //}
    Collections.sort(list,new Judge());
    for(Restraunt restraunt:list){
      System.out.println(restraunt.idget());
    }

Compiler output:
Main.java:7: error: invalid method declaration; return type required
  Restraunt(int id,String name,int score){
  ^
Main.java:52: error: reached end of file while parsing
    }
     ^
2 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] info = new String[n];
      for(int i = 0;i < n;iL++){
      	info[i] = sc.next()+"_"+(1100-sc.nextInt())+"_"+(i+1);
      }
      Arrays.sort(info);
      for(int i = 0;i < n;i++){
      	String[] s = info[i].split("_");
        System.out.println(s[2]);
      }
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
      for(int i = 0;i < n;iL++){
                          ^
  symbol:   variable iL
  location: class Main
1 error
Language: C

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	int n;
	cin >> n;
	int tmp;
	vector<string>s(n);
	vector<string>s2(n);
	vector<int>p(n);
	vector<int>t(n);
	for (int i = 0; i < n; i++) {
		cin >> s[i] >> p[i];
		t[i] = i;
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n-1; j++) {
			if (s[j] > s[j+1]) {
				swap(t[j], t[j+1]);
				swap(s[j], s[j+1]);
				swap(p[j], p[j + 1]);
			}
			if (s[j] == s[j+1] && p[j] < p[j+1]) {
				swap(t[j], t[j+1]);
				swap(s[j], s[j + 1]);
				swap(p[j], p[j + 1]);
			}
		}
	}
	for (int i = 0; i < n; i++) {
		cout << t[i]+1 << endl;
		//cout << p[i] << endl;
	}

}

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

import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] info = new String[n];

        for(int i = 0;i < n;i++){
            info[i] = sc.next() + "_" + (1100 - sc.nextInt()) + "_" +(i+1);
        }
        Arrays.sort(info);
        for(int i = 0;i < n;i++){
            String[] s = ans[i].split("_");
            System.out.println(s[2]);
        }
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
            String[] s = ans[i].split("_");
                         ^
  symbol:   variable ans
  location: class Main
1 error
Language: C++

#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iterator>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <time.h>
#include <complex>
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define INF 999999999
#define rep(i,n) for(int (i)=0;(i)<n;(i)++)
#define Rrep(i,n) for(int i=n;i>0;i--)
#define arep(a,i,n) for(int i=a;i<n;i++)
#define SORT(v) sort((v).begin(),(v).end())
#define TEMP(type,x,y) do {temp temp=x,x=y,y=temp}while(0)

typedef struct _guidebook{
	string s;
	int point;
	int num;
}guidebook;

bool cmp2(const guidebook &a, const guidebook &b) {
	
	return a.s == b.s ? a.point > b.point : a.s < b.s;
}

int main() {

	int n;
	cin >> n;
	vector<guidebook>guidebooks(n);

	for (int i = 0; i < n; i++) {
		cin >> guidebooks[i].s >> guidebooks[i].point;
		guidebooks[i].num = i + 1;
	}

	sort(guidebooks.begin(), guidebooks.end(), cmp2);

	for (int i = 0; i < n; i++) {
		cout << guidebooks[i].num << endl;
	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: 'cin' was not declared in this scope
   38 |         cin >> n;
      |         ^~~
a.cc:14:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   13 | #include <cmath>
  +++ |+#include <iostream>
   14 | using namespace std;
a.cc:49:17: error: 'cout' was not declared in this scope
   49 |                 cout << guidebooks[i].num << endl;
      |                 ^~~~
a.cc:49:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main(){
  int n; cin >> n;
  vector<tuple<string,int,int>> a;
  for(int i = i; i <= n; ++i){
    string s;
    int p;
    cin >> s >> 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;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
   12 |     a.push_back(tie(s,-p,i));
      |                       ^~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/tuple:2791:19: note:   initializing argument 2 of 'constexpr std::tuple<_Elements& ...> std::tie(_Elements& ...) [with _Elements = {__cxx11::basic_string<char, char_traits<char>, allocator<char> >, int, int}]'
 2791 |     tie(_Elements&... __args) noexcept
      |         ~~~~~~~~~~^~~~~~~~~~
a.cc:16:13: error: insufficient contextual information to determine type
   16 |     cout << get<2>.(a[i]) << endl;
      |             ^~~~~~
Language: C++

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

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

int main() {
    int n; cin >> n;
    string s;
    int p;
    pair<pair<string, int>, int> x[n]; 
    rep(i, n){
        cin >> s >> p;
        x[i] = make_pair(make_pair(s, -p), i);
    }

    sort(x, x+n;

    rep(i, n) cout << x[i].second+1 << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: expected ')' before ';' token
   16 |     sort(x, x+n;
      |         ~      ^
      |                )
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};


  
int main(){
  
  int n;
  cin>>n;
  
  string s;
  int p;
  vector<pair<string,pair<int,int>>> shops;
  REP(i,n){
    cin>>s>>p;
    shops.push_back(make_pair(s,make_pair(-p,i+1)));
  }
  sort(shops.begin(),shops.end());
  
  REP(i,n){
    cout<<shops.second.second<<endl;
  }
  return 0;
}


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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};


  
int main(){
  
  int n;
  cin>>n;
  
  string s;
  int p;
  pair<string,pair<int,int>> shops;
  REP(i,n){
    cin>>s>>p;
    shops.push_back(make_pair(s,make_pair(-p,i+1)));
  }
  sort(shops.begin(),shops.end());
  
  REP(i,n){
    cout<<shops.second.second<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:101:11: error: 'struct std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> >' has no member named 'push_back'
  101 |     shops.push_back(make_pair(s,make_pair(-p,i+1)));
      |           ^~~~~~~~~
a.cc:103:14: error: 'struct std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> >' has no member named 'begin'
  103 |   sort(shops.begin(),shops.end());
      |              ^~~~~
a.cc:103:28: error: 'struct std::pair<std::__cxx11::basic_string<char>, std::pair<int, int> >' has no member named 'end'
  103 |   sort(shops.begin(),shops.end());
      |                            ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std ;
int main(){
    int N ;
    cin >> N ;
    vector<pair<char,int>> p(N) ;
    for(int i = 0; i < N; i++){
       char a ;
       int b ;
       cin >> a >> b ;
       p(i) = make_pair(a,b) ;
    }
    sort(p.begin(), p.end() ) ;
    for(int i = 0; i < N; i++){
        char a;
        int b ;
        tie(a, b) = p(i) ;
        cout << a << " " << b << endl ;
    }
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: no match for call to '(std::vector<std::pair<char, int> >) (int&)'
   13 |        p(i) = make_pair(a,b) ;
      |        ~^~~
a.cc:19:22: error: no match for call to '(std::vector<std::pair<char, int> >) (int&)'
   19 |         tie(a, b) = p(i) ;
      |                     ~^~~