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

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{   int n;
 cin>>n;
   vector<int> vec(n);
    for(int i=0;i<n;i++){
        cin>>vec.at(i);
    }
        sort(vec.begin(),vec.end());
for(int i=0;i<n;i++){
cout<<vec.at(i);
} 
 
    
    
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/



Compiler output:
a.cc: In function 'int main()':
a.cc:8:4: error: 'vector' was not declared in this scope
    8 |    vector<int> vec(n);
      |    ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:11: error: expected primary-expression before 'int'
    8 |    vector<int> vec(n);
      |           ^~~
a.cc:10:14: error: 'vec' was not declared in this scope
   10 |         cin>>vec.at(i);
      |              ^~~
a.cc:12:14: error: 'vec' was not declared in this scope
   12 |         sort(vec.begin(),vec.end());
      |              ^~~
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |         sort(vec.begin(),vec.end());
      |         ^~~~
      |         short
Language: C++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{   int n;
 cin>>n;
   vector<int> vec(n);
    for(int i=0;i<n;i++){
        cin>>vec.at(i);
    }
        sort(vec.begin(),vec.end());
for(int i=0;i<n;i++){
cout<<vec.at(i);
} 
 }
 
    
    
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/



Compiler output:
a.cc: In function 'int main()':
a.cc:8:4: error: 'vector' was not declared in this scope
    8 |    vector<int> vec(n);
      |    ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:11: error: expected primary-expression before 'int'
    8 |    vector<int> vec(n);
      |           ^~~
a.cc:10:14: error: 'vec' was not declared in this scope
   10 |         cin>>vec.at(i);
      |              ^~~
a.cc:12:14: error: 'vec' was not declared in this scope
   12 |         sort(vec.begin(),vec.end());
      |              ^~~
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |         sort(vec.begin(),vec.end());
      |         ^~~~
      |         short
a.cc: At global scope:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include<iostream>

using namespace std;

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

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

	int num=i;

	rest obtmp;

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

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

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{   int n;
 cin>>n;
   vector<string> vec(n);
    for(int i=0;i<n;i++){
        cin>>vec.at(i);
    }
        sort(vec.begin(),vec.end());
for(int i=0;i<n;i++){
cout<<vec.at(i);
} 
 }
 
    
    
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/



Compiler output:
a.cc: In function 'int main()':
a.cc:8:4: error: 'vector' was not declared in this scope
    8 |    vector<string> vec(n);
      |    ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:17: error: expected primary-expression before '>' token
    8 |    vector<string> vec(n);
      |                 ^
a.cc:8:19: error: 'vec' was not declared in this scope
    8 |    vector<string> vec(n);
      |                   ^~~
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |         sort(vec.begin(),vec.end());
      |         ^~~~
      |         short
a.cc: At global scope:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i=0;i<n;i++)
      |             ^
a.cc:13:13: error: 'i' was not declared in this scope
   13 |         for(i=0;i<n;i++)
      |             ^
a.cc:19:21: error: 'j' was not declared in this scope
   19 |                 for(j=0;j<n;j++)
      |                     ^
a.cc:22:17: error: expected primary-expression before '}' token
   22 |                 }
      |                 ^
Language: C++

#include<stdio.h>
#include<string.h>
int main(void){
  int n,i,j,k,t;
  scanf("%d",&n);
  char s[n][11],o;
  int p[n];
  for(i=0;i<n;i++){
    scanf("%s %d",s[i],&p[i]);
  }
  int z[10];
  for(k=0;k<10;k++){
    z[k]=k+1;
  }
  for(i=1;i<n;i++){
    for(j=1;j<n;j++){
      if(strcmp(s[j-1], s[j])>0){
        strcpy(o, s[j-1]);
        strcpy(s[j-1], s[j]);
        strcpy(s[j], o);
        t=z[j-1];
        z[j-1]=z[j];
        z[j]=t;
      }
      else if(s[j-1]==s[j]){
        if(p[j-1]>p[j]){
          strcpy(o, s[j-1]);
          strcpy(s[j-1], s[j]);
          strcpy(s[j], o);
          t=z[j-1];
          z[j-1]=z[j];
          z[j]=t;
        }
      }
    }
  }
  for (i=0;i<n;i++){
    printf("%d\n",z[i]);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   18 |         strcpy(o, s[j-1]);
      |                ^
      |                |
      |                char
In file included from a.cc:2:
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:20:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   20 |         strcpy(s[j], o);
      |                      ^
      |                      |
      |                      char
/usr/include/string.h:141:70: note:   initializing argument 2 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:27:18: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   27 |           strcpy(o, s[j-1]);
      |                  ^
      |                  |
      |                  char
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:29:24: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   29 |           strcpy(s[j], o);
      |                        ^
      |                        |
      |                        char
/usr/include/string.h:141:70: note:   initializing argument 2 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
Language: C++

#include<iostream>

using namespace std;

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

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

	int num=i;

	rest obtmp;

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

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

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

using namespace std;
int main(){
int n;
cin>>n;
string s[n];
int p[n];
vector<string> vec_s;
map<string,int> mp;
for(int i=0;i<n;i++){
cin >>s[i]>>p[i];
vec_s.push_back(s[i]+","+to_string(100-p[i]));
}
sort(vec_s.begin(),vec_s.end());

for(int i=0;i<vec_s.size();i++){
vector<string>ans;

string buf;
stringstream ss(vec_s[i]);
while(getline(ss,buf,',')){
ans.push_back(buf);
}

int num = 100-atoi(ans[1].c_str());
for(int i=0;i<n;i++){
if(p[i]==num){
cout<<i+1<<endl;
}

}
}


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

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

int main(){
  int N;
  cin >> N;
  string tmp;
  vector<string> S(N);
  vector<int> P(N);
  
  for(int i=0;i<N;i++){
    cin >> S.at(i) >> P.at(i);
    
    for(int j=0;j<i;j++){
      for(int k=0;k<S.at(j).length;k++){
        if(S.at(i).at(j)<S.at(i-1).at(j)){
          tmp = S.at(i-1);
          S.at(i)
        }
      }
    }
  }
  
   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   15 |       for(int k=0;k<S.at(j).length;k++){
      |                     ~~~~~~~~^~~~~~
      |                                   ()
a.cc:18:18: error: expected ';' before '}' token
   18 |           S.at(i)
      |                  ^
      |                  ;
   19 |         }
      |         ~         
a.cc:18:15: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   18 |           S.at(i)
      |           ~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: declared here
 1180 |       at(size_type __n)
      |       ^~
Language: C++

from sys import stdin, stdout

n = int(stdin.readline().rstrip())

d1 = dict()

for i in range(n):
	s, p = [x for x in stdin.readline().rstrip().split()]
	if (s not in d1.keys()):
		d1[s] = []
		d1[s].append((int(p), i + 1))
	else:
		d1[s].append((int(p), i + 1))

for v in d1.values():
	v.sort(reverse = True)

l1 = list()

for k, v in d1.items():
		l1.append((k, v))

l1.sort()

for i in range(len(l1)):
	for j in l1[i][1]:
		stdout.write(str(j[1]) + "\n")

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from sys import stdin, stdout
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

struct Info{
  string s;
  int p;
  int orig_num;

  bool operator<(const Info &another) const{
    return (s == another.s) ? (p > another.p) : s < another.s;
  }
};

struct InfoB{
  int num;  // 紹介順
  int orig_num;
  bool operator<(const InfoB &another) const{
    return orig_num < another.ori	_num;
  }
};
int main(){
  int n;
  vector <Info> ifo;
  cin >> n;
  cin.ignore();
  Info infom;
  for (int i = 0; i < n; i++){
    cin >> infom.s >> infom.p;
    infom.orig_num = i;
    cin.ignore();
    ifo.push_back(infom);
  }
  sort(ifo.begin(), ifo.end());

  for (int i = 0; i < n; i++){
    //cout << ifo[i].s << " " << ifo[i].p << endl;
    cout << ifo[i].orig_num + 1 << endl;
  }

  return 0;
  
}


Compiler output:
a.cc: In member function 'bool InfoB::operator<(const InfoB&) const':
a.cc:19:31: error: 'const struct InfoB' has no member named 'ori'
   19 |     return orig_num < another.ori       _num;
      |                               ^~~
a.cc:19:41: error: expected ';' before '_num'
   19 |     return orig_num < another.ori       _num;
      |                                         ^~~~
a.cc:19:41: error: '_num' was not declared in this scope; did you mean 'num'?
   19 |     return orig_num < another.ori       _num;
      |                                         ^~~~
      |                                         num
Language: C++

#include<stdio.h>
#include<vector>
#include<algorithm>
using std::string;
struct Info {
public:
	int i;
	string s;
	int p;
	bool operator< (const Info &b)const {
		if (s == b.s) {
			return p > b.p;
		}
		else {
			return s < b.s;
		}
	}
};


int main()
{
	int N = 0;
	std::vector<Info> info;
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		char s[11];
		int q = 0;
		scanf("%s %d", s, &q);
		Info data = { i,s,q };
		info.push_back(data);
	}
	sort(info.begin(), info.end());
	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].i + 1);
	}
}

Compiler output:
a.cc:4:12: error: 'string' has not been declared in 'std'
    4 | using std::string;
      |            ^~~~~~
a.cc:8:9: error: 'string' does not name a type; did you mean 'stdin'?
    8 |         string s;
      |         ^~~~~~
      |         stdin
a.cc: In member function 'bool Info::operator<(const Info&) const':
a.cc:11:21: error: 's' was not declared in this scope
   11 |                 if (s == b.s) {
      |                     ^
a.cc:11:28: error: 'const struct Info' has no member named 's'
   11 |                 if (s == b.s) {
      |                            ^
a.cc:15:38: error: 'const struct Info' has no member named 's'
   15 |                         return s < b.s;
      |                                      ^
a.cc: In function 'int main()':
a.cc:30:37: error: too many initializers for 'Info'
   30 |                 Info data = { i,s,q };
      |                                     ^
Language: C++

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

int main(){
  struct list{
  pair<string,int> resta;
  int num;
};
  int N; cin >> N;
  int a,b,c;
  for(int i=0;i<N;i++){
    cin >> b >> c;
    list.resta.push(make_pair(b,c));
  }
  for(int i=0;i<N;i++)
  { list[i].num = i+1;}
  sort(list.resta,list.resta+N);
  for(int i=0;i<N;i++)
  { cout << list[i].num << endl;}
}
    
  



Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: expected unqualified-id before '.' token
   13 |     list.resta.push(make_pair(b,c));
      |         ^
a.cc:16:9: error: structured binding declaration cannot have type 'main()::list'
   16 |   { list[i].num = i+1;}
      |         ^~~
a.cc:16:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:16:10: error: redeclaration of 'auto i'
   16 |   { list[i].num = i+1;}
      |          ^
a.cc:15:11: note: 'int i' previously declared here
   15 |   for(int i=0;i<N;i++)
      |           ^
a.cc:16:12: error: expected initializer before '.' token
   16 |   { list[i].num = i+1;}
      |            ^
a.cc:16:12: error: expected ';' before '.' token
a.cc:17:12: error: expected primary-expression before '.' token
   17 |   sort(list.resta,list.resta+N);
      |            ^
a.cc:17:23: error: expected primary-expression before '.' token
   17 |   sort(list.resta,list.resta+N);
      |                       ^
a.cc:19:17: error: expected primary-expression before '[' token
   19 |   { cout << list[i].num << endl;}
      |                 ^
Language: C

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

int main(void){
  int n;
  
  scanf("%d",&n);
  
  char shop[101][12];
  int ten[101];
  int ans[101] = {0};
  
  for(int i = 0; i < n; i++){
    scanf("%s %d", shop[i], &ten[i]);
    if(i == 0){
      ans[i] = 1;
    }
    else{
      ans[i] = 1;
      for(int j = i; j > 0; j--){
        if(strcmp(shop[j - 1], shop[i]) > 0){
          ans[j - 1] += 1;
        }
        else if(strcmp(shop[j - 1], shop[i]) < 0){
          ans[i] += 1;
        }
        else{
          if(ten[j - 1] < ten[i]){
            ans[j - 1] += 1;
          }
          else{
            ans[i] += 1;
          }          
        }       
      }
    }
  }
    
   for(int i = 1; i <= n; i++){
     for(int j = 0; j < n; j++){
       if(ans[j] == i){
         printf("%d", j + 1);
       }
   }
 }

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

#include<iostream>
#include<cstdio>
#include<iomanip>
#include<algorithm>
#include<bits/stdc++.h>
#include<string>
#include<cmath>
using namespace std;

int main(){
  int N;
  cin>>N;
  
  
  vector<pair<string,int>> WWW;
  for(int i=0; i<N; ++i){
    string S;
    int a;
    WWW.push_back(make_pair(S,a));
  }
  
  int AA[N-1];
  for(int i=0; i<N; ++i) AA[i]=0;
  
  bool CAN[N-1];
  for(int i=0; i<N; ++i) CAN[i]=true;
  
  for(int i=0; i<N; ++i){
    int t=0;
    for(int j=0; j<N; ++j){
      if((WWW[t].first>=WWW[j].first && WWW[t].second<WWW[j].second) && CAN[j]=true){
        t=j;
      }
    }
    CAN[t]=false;
    AA[t]=i+1;
  }
  
  for(int i=0; i<N; ++i) cout<<AA[i]<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:70: error: lvalue required as left operand of assignment
   31 |       if((WWW[t].first>=WWW[j].first && WWW[t].second<WWW[j].second) && CAN[j]=true){
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
Language: C++

#include<stdio.h>
#include<vector>
#include<algorithm>
struct Info {
public:
	int i;
	string s;
	int p;
	bool operator< (const Info &b)const {
		if (s == b.s) {
			return p > b.p;
		}
		else {
			return s < b.s;
		}
	}
};


int main()
{
	int N = 0;
	std::vector<Info> info;
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		char s[11];
		int q = 0;
		scanf("%s %d", s, &q);
		Info data = { i,s,q };
		info.push_back(data);
	}
	sort(info.begin(), info.end());
	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].i + 1);
	}
}

Compiler output:
a.cc:7:9: error: 'string' does not name a type; did you mean 'stdin'?
    7 |         string s;
      |         ^~~~~~
      |         stdin
a.cc: In member function 'bool Info::operator<(const Info&) const':
a.cc:10:21: error: 's' was not declared in this scope
   10 |                 if (s == b.s) {
      |                     ^
a.cc:10:28: error: 'const struct Info' has no member named 's'
   10 |                 if (s == b.s) {
      |                            ^
a.cc:14:38: error: 'const struct Info' has no member named 's'
   14 |                         return s < b.s;
      |                                      ^
a.cc: In function 'int main()':
a.cc:29:37: error: too many initializers for 'Info'
   29 |                 Info data = { i,s,q };
      |                                     ^
Language: C++

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

struct list{
  pair<string,int> resta;
  int num;
};

int main(){
  int N; cin >> N;
  int a,b,c;
  for(int i=0;i<N;i++){
    cin >> b >> c;
    list.resta.push(make_pair(b,c));
  }
  for(int i=0;i<N;i++)
  { list[i].num = i+1;}
  sort(list.resta,list.resta+N);
  for(int i=0;i<N;i++)
  { cout << list[i].num << endl;}
}
    
  



Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: reference to 'list' is ambiguous
   14 |     list.resta.push(make_pair(b,c));
      |     ^~~~
In file included from /usr/include/c++/14/list:65,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:4:8: note:                 'struct list'
    4 | struct list{
      |        ^~~~
a.cc:17:5: error: reference to 'list' is ambiguous
   17 |   { list[i].num = i+1;}
      |     ^~~~
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:4:8: note:                 'struct list'
    4 | struct list{
      |        ^~~~
a.cc:18:8: error: reference to 'list' is ambiguous
   18 |   sort(list.resta,list.resta+N);
      |        ^~~~
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:4:8: note:                 'struct list'
    4 | struct list{
      |        ^~~~
a.cc:18:19: error: reference to 'list' is ambiguous
   18 |   sort(list.resta,list.resta+N);
      |                   ^~~~
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:4:8: note:                 'struct list'
    4 | struct list{
      |        ^~~~
a.cc:20:13: error: reference to 'list' is ambiguous
   20 |   { cout << list[i].num << endl;}
      |             ^~~~
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:4:8: note:                 'struct list'
    4 | struct list{
      |        ^~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main(void){
  int n,i,j,k,t;
  scanf("%d",&n);
  char s[n][11];
  int p[n];
  for(i=0;i<n;i++){
    scanf("%s %d",s[n],&p[n]);
  }
  int z[10];
  for(k=0;k<10;k++){
    z[k]=k+1;
  }
  for(i=1;i<n;i++){
    for(j=1;j<n;j++){
      if(strcmp(s[j-1], s[j])>0){
        t=z[j-1]);
        z[j-1]=z[j];
        z[j]=t;
      }
      else if(strcmp(s[j-1],s[j])==0){
        if(p[j-1]>p[j]){
          t=z[j-1];
          z[j-1]=z[j];
          z[j]=t;
        }
      }
    }
  }
  for (i=0;i<n;i++){
    printf("%d\n",z[i]);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: expected ';' before ')' token
   18 |         t=z[j-1]);
      |                 ^
      |                 ;
Language: C++

#include <string.h>
#include<stdio.h>
#include<vector>
#include<algorithm>
struct Info {
public:
	int i;
	std::string s;
	int p;
	bool operator< (const Info &b)const {
		if (s == b.s) {
			return p > b.p;
		}
		else {
			return s < b.s;
		}
	}
};


int main()
{
	int N = 0;
	std::vector<Info> info;
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		char s[11];
		int q = 0;
		scanf("%s %d", s, &q);
		Info data = { i,s,q };
		info.push_back(data);
	}
	sort(info.begin(), info.end());
	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].i + 1);
	}
}

Compiler output:
a.cc:8:14: error: 'string' in namespace 'std' does not name a type
    8 |         std::string s;
      |              ^~~~~~
a.cc:5:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    4 | #include<algorithm>
  +++ |+#include <string>
    5 | struct Info {
a.cc: In member function 'bool Info::operator<(const Info&) const':
a.cc:11:21: error: 's' was not declared in this scope
   11 |                 if (s == b.s) {
      |                     ^
a.cc:11:28: error: 'const struct Info' has no member named 's'
   11 |                 if (s == b.s) {
      |                            ^
a.cc:15:38: error: 'const struct Info' has no member named 's'
   15 |                         return s < b.s;
      |                                      ^
a.cc: In function 'int main()':
a.cc:30:37: error: too many initializers for 'Info'
   30 |                 Info data = { i,s,q };
      |                                     ^
Language: C++

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


struct  res
{
	string s1;
	int p;
	int cnt;
}r[1000];

bool cmp(const res a, const res b)
	{
		int len1=a.s1.length();
		int len2=b.s1.length();
		if(len1==len2)
			{
				return a.p>b.p;
			}
		int len=max(len1,len2);
		//int flag=1;
		if(len1>len2)
		{
		for (int i=0;i<len2;i++)
			{
				if(a.s1[i]==b.s1[i])
					//continue;
				else 
					{
						//flag=0;
						return a.s1[i]<b.s1[i];
					}
			}
			return true;
		}
		else 
			{
				for (int i=0;i<len1;i++)
			{
				if(a.s1[i]==b.s1[i])
					//continue;
				else 
					{
						//flag=0;
						return a.s1[i]<b.s1[i];
					}
			}
			return false;
			}
	}

int main()
	{
		int n;
		cin>>n;
		for (int i=0;i<n;i++)
			{
				cin>>r[i].s1>>r[i].p;
				r[i].cnt=i+1;
			}
		sort(r,r+n,cmp);
		for (int i=0;i<n;i++)
			{
			
				//cout<<r[i].s1<<endl;
				cout<<r[i].cnt<<endl;
			

			}

	}

Compiler output:
a.cc: In function 'bool cmp(res, res)':
a.cc:28:33: error: expected primary-expression before 'else'
   28 |                                 else
      |                                 ^~~~
a.cc:42:33: error: expected primary-expression before 'else'
   42 |                                 else
      |                                 ^~~~
Language: C++

#include<stdio.h>
#include<vector>
#include<algorithm>
struct Info {
public:
	int i;
	std::string s;
	int p;
	bool operator< (const Info &b)const {
		if (s == b.s) {
			return p > b.p;
		}
		else {
			return s < b.s;
		}
	}
};


int main()
{
	int N = 0;
	std::vector<Info> info;
	scanf_s("%d", &N);
	for (int i = 0; i < N; i++) {
		char s[11];
		int q = 0;
		scanf("%s %d", s, &q);
		Info data = { i,s,q };
		info.push_back(data);
	}
	sort(info.begin(), info.end());
	for (int i = 0; i < N; i++) {
		printf("%d\n", info[i].i + 1);
	}
}

Compiler output:
a.cc:7:14: error: 'string' in namespace 'std' does not name a type
    7 |         std::string s;
      |              ^~~~~~
a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    3 | #include<algorithm>
  +++ |+#include <string>
    4 | struct Info {
a.cc: In member function 'bool Info::operator<(const Info&) const':
a.cc:10:21: error: 's' was not declared in this scope
   10 |                 if (s == b.s) {
      |                     ^
a.cc:10:28: error: 'const struct Info' has no member named 's'
   10 |                 if (s == b.s) {
      |                            ^
a.cc:14:38: error: 'const struct Info' has no member named 's'
   14 |                         return s < b.s;
      |                                      ^
a.cc: In function 'int main()':
a.cc:24:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   24 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
a.cc:29:37: error: too many initializers for 'Info'
   29 |                 Info data = { i,s,q };
      |                                     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pii pair<int, int>
#define pb push_back
#define pli pair<ll, int>
#define pil pair<int, ll>
#define clr(a, x) memset(a, x, sizeof(a))

const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;

/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define TREE tree<pli, null_type, greater<pli>, rb_tree_tag, tree_order_statistics_node_update>
TREE T;
*/

struct gg {
	string s;
	int p, id;
	bool operator < (const gg &g) const {
		return s < g.s ? s == g.s && p > g.p;
	}
} g[105];
int main() {
	int n; scanf("%d", &n);
	for (int i = 1; i <= n; ++i) {
		cin >> g[i].s >> g[i].p; g[i].id = i;
	}
	sort(g + 1, g + n + 1);
	for (int i = 1; i <= n; ++i) cout << g[i].id << endl;
	return 0;
}



Compiler output:
a.cc: In member function 'bool gg::operator<(const gg&) const':
a.cc:29:53: error: expected ':' before ';' token
   29 |                 return s < g.s ? s == g.s && p > g.p;
      |                                                     ^
a.cc:29:53: error: expected primary-expression before ';' token
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

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

        char alphabet[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
        
        int n = Integer.parseInt(br.readLine());
    
        ArrayList<String> list = new ArrayList<String>();
        Integer p[] = new Integer[n];
        for(int i=0;i<n;i++){
            String str = new String(br.readLine());
            list.add(str.split("\\s+")[0]);
            p[i] = Integer.parseInt(str.split("\\s+")[1]);
        }

        Collections.sort(list);

        int j=0;
        while(!(list == null || list.size() == 0)){
            String str = list.get(j);
            int counter = list.indexOf(str);
            for(int k=0;k<counter;k++) list.remove(k);

            for(int l=0;l<p.length;l++){
                if(p[l] )
            }

            j=k+1;
        }
    }
}

Compiler output:
Main.java:32: error: illegal start of statement
            }
            ^
1 error
Language: C++

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

typedef std::tuple<string, int, int> mytuple;

// タプルの最初の要素から順番に比較　もしその要素が同じなら次の要素で比較
bool mycompare( const mytuple &lhs, const mytuple &rhs )
{
  if (std::get<0>(lhs) != std::get<0>(rhs)) return std::get<0>(lhs) < std::get<0>(rhs);
  if (std::get<1>(lhs) != std::get<1>(rhs)) return std::get<1>(lhs) > std::get<1>(rhs);
  return std::get<2>(lhs) < std::get<2>(rhs);
}

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

  vector<tuple<string, int, int>> t;
  for(int i = 0; i < n; i++) {
    string s;
    int p;
    cin >> s >> p;
    t.emplace_back(s, p, i+1);
  }

  sort(t.begin(), t.end(), mycompare);

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


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

import java.util.*;

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

        int n = sc.nextInt();
        Map<String,Integer> map = HashMap<>();

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

        Collections.sort(map);
        for(String x : map){
            System.out.println(x);
        }
    }
}

Compiler output:
Main.java:8: error: illegal start of expression
        Map<String,Integer> map = HashMap<>();
                                          ^
Main.java:8: error: -> expected
        Map<String,Integer> map = HashMap<>();
                                             ^
2 errors
Language: C++

#include <iostream>
#include <queue>
#include <vector>

using namespace std;

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

struct City {
    string name;
    ll point;
    ll ini;

    City(string inputted_name, ll inputted_point, ll inputted_ini) {
        name = inputted_name;
        point = inputted_point;
        ini = inputted_ini;
    }

    bool operator<(const City &another) const {
        if (name < another.name) {
            return true;
        } else if (name == another.name) {
            if (point > another.point) {
                return true;
            }
            return false;
        }
        return false;
    };
};


int main() {
    ll N;
    cin >> N;
    vector<City> p;

    ll P;
    string S;
    rep (i, N) {
        cin >> S >> P;
        p.push_back(City(S, P, i + 1));
    }


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

    rep(i, p.size()) {
        cout << p[i].ini << endl;
    }
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int n;
    cin >> n;
    vector<pair<string,int>> restaurant(n);
    string s;
    int p;
    for (int i = 0; i<n ; i++){
        cin >> s >> p;
        restaurant.at(i) = make_pair(s,p);
    }
    vector<int> number(n);
    for (int i=0;i<n;i++) {
        number.at(i) = i+1;
    }
    int count = 0;
    char str1[10];
    char str2[10];
    for (;count < n;){
        count = 0;
        for (int i = 0; i<n ;i++) {
            str1 = restaurant.at(i).first;
            str2 = restaurant.at(i+1).first;
            if (strcmp(str1,str2)<0){
                //そのまま
                count++;
            }
            else if (strcmp(str1,str2))>0){
                swap(restaurant.at(i),restaurant.at(i+1));
                swap(number.at(i),number.at(i+1));
            }
            else {
                if (restaurant.at(i).second > restaurant.at(i+1).second){
                    //そのまま
                    count++;
                }
                else {
                    swap(restaurant.at(i),restaurant.at(i+1));
                    swap(number.at(i),number.at(i+1));
                }
            }
        }
    }
    for (int i= 0;i<n;i++){
        cout<<number.at(i)<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: incompatible types in assignment of 'std::__cxx11::basic_string<char>' to 'char [10]'
   24 |             str1 = restaurant.at(i).first;
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:18: error: incompatible types in assignment of 'std::__cxx11::basic_string<char>' to 'char [10]'
   25 |             str2 = restaurant.at(i+1).first;
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:30:40: error: expected primary-expression before '>' token
   30 |             else if (strcmp(str1,str2))>0){
      |                                        ^
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<string>

#define lli long long int
#define loop(i,n) for (lli i = 0; i < n; i++)
struct names{
string s;
lli score;
lli ind;
};

bool cmpfunc(names A , names B){
if(A.s == B.s)
    return(A.score>B.score);
return(A.s<B.s);
}
int main(){
lli n;
cin>>n;
names a[n];
loop(i,n){
cin>>a[i].s>>a[i].score;
a[i].ind = i+1;
}
sort(a,a+n,cmpfunc);
loop(i,n){
cout<<a[i].ind<<endl;
}
return 0;
}

Compiler output:
a.cc:9:1: error: 'string' does not name a type; did you mean 'stdin'?
    9 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'bool cmpfunc(names, names)':
a.cc:15:6: error: 'struct names' has no member named 's'
   15 | if(A.s == B.s)
      |      ^
a.cc:15:13: error: 'struct names' has no member named 's'
   15 | if(A.s == B.s)
      |             ^
a.cc:17:10: error: 'struct names' has no member named 's'
   17 | return(A.s<B.s);
      |          ^
a.cc:17:14: error: 'struct names' has no member named 's'
   17 | return(A.s<B.s);
      |              ^
a.cc: In function 'int main()':
a.cc:21:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   21 | cin>>n;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:24:11: error: 'struct names' has no member named 's'
   24 | cin>>a[i].s>>a[i].score;
      |           ^
a.cc:27:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   27 | sort(a,a+n,cmpfunc);
      | ^~~~
      | std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:29:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   29 | cout<<a[i].ind<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:29:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   29 | cout<<a[i].ind<<endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

#define ll long long

int main() {
	// your code goes here
	ll a, b, c, n;
	cin >> n;
	vector<pair<string, ll>> s(n);
	for(ll i = 0; i < n; i++){
		string ss;
		ll p;
		cin >> ss >> p;
		if(p > 90 && p != 100){
			ss += "0";
			ss += to_string(10 - (p % 10));
		}else if (p < 10 && p != 0){
			ss += "9";
			ss += to_string(10 - (p % 10));
		}else if(p == 100){
			ss+= "000";
		}else if(p == 0){
			ss += "9999"
		}else{
			ss += to_string(100 - p);
		}
		s[i] = make_pair(ss ,i + 1);
	}
	sort(s.begin(), s.end());
	for(int i = 0 ; i < n; i++){
		cout <<s[i].second << endl;
	}
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:37: error: expected ';' before '}' token
   24 |                         ss += "9999"
      |                                     ^
      |                                     ;
   25 |                 }else{
      |                 ~
Language: C++

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

int main(){
    int n,p,a;
    cin >> n;
    string s;
    vector<pair<string,int>> r(n),c(n);
    for(int i=0;i<n;i++){
        cin >> s >> p;
        ostringstream ss;
        ss << i+1;
        s=s+ss.str();
        r[i].first=s;
        r[i].second=-1*p;
    }
    sort(r.begin(),r.end());
    for(int i=0;i<n;i++){
        cout << r[i].first[r[i].size()] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'size'
   24 |         cout << r[i].first[r[i].size()] << endl;
      |                                 ^~~~
Language: C++

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

using namespace std;

int main() {
    int n;

    cin >> n;

    vector<tuple<int, string, int>> ss;

    for(int i = 1; i <= n; i++){
        string s;
        int p;
        cin >> s >> p;
        tuple<int, string, int> e(i, s, p);
        ss.push_back(e);
    }

    std::sort(ss.begin(), ss.end(), [](tuple<int, string, int> l, tuple<int, string, int> r){
        if (std::get<1>(l) == std::get<1>(r)) {
            return std::get<2>(l) > std::get<2>(r);
        }
        return std::get<1>(l) < std::get<1>(r);
    });

    for(auto &e : ss){
        cout << get<0>(e) << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   22 |     std::sort(ss.begin(), ss.end(), [](tuple<int, string, int> l, tuple<int, string, int> r){
      |          ^~~~
      |          qsort
Language: C++

#include <algorithm>
#include<vector>
#include<string>
using namespace std;
int main() {
int n,p[100],i=0,j=0,k[100],m;
string city[100],buffer;
cin>>n;
while(i<n){
cin>>city[i];cin>>p[i];
i++;
k[i]=i;
}
i=0;
while(i<n){
	j=i+1;
	while(j<n){
		if(city[i]>city[j]){
			buffer=city[i];
			m=k[i];
			city[i]=city[j];
			k[i]=k[j];
			city[j]=buffer;
			k[j]=m;
			m=p[i];
			p[i]=p[j];
			p[j]=m;
		}
		j++;
	}
	i++;
}
i=0;
while(i<n){
	j=i+1;
	while(j<n){
		if(city[i]==city[j]){
			if(p[i]>p[j]){
			buffer=city[i];
			m=k[i];
			city[i]=city[j];
			k[i]=k[j];
			city[j]=buffer;
			k[j]=m;
			m=p[i];
			p[i]=p[j];
			p[j]=m;
			}
		}
		j++;
	}
	i++;
}
i=0;
while(i>n){
cout<<k[i]<<"\n";
i++;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope
    8 | cin>>n;
      | ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<string>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:56:1: error: 'cout' was not declared in this scope
   56 | cout<<k[i]<<"\n";
      | ^~~~
a.cc:56:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main(){
    int n,s,p,a;
    cin >> n;
    vector<pair<string,int>> r(n),c(n);
    for(int i=0;i<n;i++){
        cin >> s >> p;
        ostringstream ss;
        ss << i+1;
        s=s+str();
        r[i].first=s;
        r[i].second=-1*p;
    }
    sort(r.begin(),r.end());
    for(int i=0;i<n;i++){
        cout << r[i].first[r[i].size()] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'str' was not declared in this scope; did you mean 'std'?
   17 |         s=s+str();
      |             ^~~
      |             std
a.cc:23:33: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'size'
   23 |         cout << r[i].first[r[i].size()] << endl;
      |                                 ^~~~
Language: C++

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

template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;

using ll = long long;
using db = double;
using ldb = long db;
using str = string;
using vll = V<ll>;
using vvll = V<V<ll>>;
using pll = P<ll,ll>;
using tpll = TP<ll,ll,ll>;
using vpll =V<pll>;
using vst = V<str>;
using vch = V<char>;

#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(b);i>(ll)(a);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) __lcm(a,b)
#define co(a) cout<<a<<endl
#define ci(a) cin>>a
#define pb(a) push_back(a)
#define pob pop_back()
#define mp make_pair
#define mt make_tuple
#define pbmp(a,b) push_back(mp(a,b))
#define subs(a,b) substr(a,b)
#define INF 1e16
#define mod 1e9+7


int main() {
  ll n;
  cin>>n;
/*  V<TP<ll,str,ll>> v(n);
  FOR(i,0,n){
    cin>>v[i].se>>v[i].fi;
    v[i].third=i;
  }
  SORT(v);
  V<TP<str,ll,ll>> ve(n);
  FOR(i,0,n){
    ve[i].fi=v[i].se;
    ve[i].se=v[i].fi;
    ve[i].third=v[i].third;
  }
  SORT(ve);
  FOR(i,0,n){
    co(ve[i].third);
  }
}*/
/*  V<P<ll,str>> v(n);
  V<P<ll,ll>> v1(n);
  FOR(i,0,n){
    cin>>v[i].se>>v[i].fi;
//    v1[i].se=i+1;
//    v1[i].fi=v[i].fi;
  }
  FOR(i,0,n){
    v1[i].se=i+1;
    v1[i].fi=v[i].fi;
  }
  SORT(v);
  SORT(v1);
  REV(v);
  REV(v1);
  V<P<str,ll>> ve(n);
 // V<P<str,ll>> ve1(n);
  FOR(i,0,n){
    ve[i].fi=v[i].se;
    ve[i].se=v1[i].se;
//    ve[i].third=v[i].third;
  }
  SORT(ve);
  FOR(i,0,n){
    co(ve[i].se);
  }
}*/
/*  V<P<str,ll>> v(n);
//  V<P<ll,ll>> v1(n);
  FOR(i,0,n){
    cin>>v[i].fi>>v[i].se;
  }
  SORT(v);
  FOR(i,0,n){
    co(v[i].se);
  }
}*/
  

Compiler output:
a.cc: In function 'int main()':
a.cc:47:10: error: expected '}' at end of input
   47 |   cin>>n;
      |          ^
a.cc:45:12: note: to match this '{'
   45 | int main() {
      |            ^
Language: C++

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

struct shop{
    int idx;
    string s;
    int p;

    shop(int inputed_index, string inputed_s, int inputed_p){
        idx = inputed_index;
        s = inputed_s;
        p = inputed_p;
    }

    bool operator<(const shop &cmp)const{
        return s==cmp.s ? p<cmp.p : s<cmp.s;
    }
}

int main() {
	int n;
    vector<shop> shops;
    cin >> n;
    for(int i=0; i<n; i++){
        string str;
        int point;
        cin >> str >> point;
        shops.push_back(shop(i+1, str, point));
    }
    sort(shops.begin(),shops.end());
  
    for(int i=0; i<n; i++){
      cout << shops[i].idx << endl;
    }
  
    return 0;
}


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

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

  return 0;
}


Compiler output:
a.cc:26:3: error: expected unqualified-id before 'return'
   26 |   return 0;
      |   ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^