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

#include <vector>
#include <array>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

typedef long long ll;

struct city {
	int ans1;
	int ans2;
};

int main() {
	ll N, M;
	cin >> N >> M;
	vector<ll> P(M), Y(M), ans(M), T(N, 1);
	vector<city> C(M);

	for (int i = 0; i < M; i++) {
		cin >> P[i] >> Y[i];
	}

	ll max = *(max_element(Y.begin(), Y.end()));

	//古いやつから消していく
	for (int i = 0; i < M; i++) {
		vector<ll>::iterator iter = min_element(Y.begin(), Y.end());
		int index = distance(Y.begin(), iter);
//		cout << "index " << index << " " << P[index] << " " << Y[index] << endl;
		C[index].ans1 = P[index];
		cout << C[index].ans1 << endl;
		C[index].ans2 = T[P[index]];
		T[(P[index])]++;
		Y[index] = max + 1;
	}

	for (int i = 0; i < M; i++) {
		printf("%06d%06d\n", C[i].ans1, C[i].ans2);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'cin' was not declared in this scope
   18 |         cin >> N >> M;
      |         ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <cmath>
  +++ |+#include <iostream>
    6 | 
a.cc:34:17: error: 'cout' was not declared in this scope
   34 |                 cout << C[index].ans1 << endl;
      |                 ^~~~
a.cc:34:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:42: error: 'endl' was not declared in this scope
   34 |                 cout << C[index].ans1 << endl;
      |                                          ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include <cmath>
  +++ |+#include <ostream>
    6 |
Language: C++

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

int main(int argc, char const *argv[])
{
    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> pys;
    map<int, vector<int>> s2ys;
    int p, y;
    for (int i=0; i<m; i++) {
        cin >> p >> y;
        pys.push_back(make_pair(p, y));
        s2ys[p].push_back(y);
    }
    
    for (auto i = s2ys.begin(); i != s2ys.end(); i++) {
        sort(i->second.begin(), i->second.end()); // 多分書き方が違う
    }

    for (int i=0; i<m; i++) {
        int p = pys[i].first;
        int y = pys[i].second;
        for (int j=0; j<s2ys[p].size(); j++) {
            if (y == s2ys[p][j]) {
                cout << setfill('0') << setw(6) << p << setfill('0') << setw(6) << j + 1 << endl;
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:21:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |         sort(i->second.begin(), i->second.end()); // 多分書き方が違う
      |         ^~~~
      |         short
Language: C++


int main(void){
	
	int N,M,i,j,lowest;
	int P[10010],Y[10010],num[10010];

	scanf("%d %d", &N, &M);
	
	for(i=0;i<=M;i++){
	scanf("%d", &P[i]);
	scanf("%d", &Y[i]);
	}
	
	for(i=0;i<=M;i++){
		lowest=Y[i];
		for(j=i+1;j<=M;i++){
			if(Y[j]<lowest)
			lowest=Y[j];
		}
		num[i]=lowest;
	}
	
	for(i=0;i<=M;i++)
	printf("%06d %06d",P[i],num[i]);
	
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf' was not declared in this scope
    7 |         scanf("%d %d", &N, &M);
      |         ^~~~~
a.cc:24:9: error: 'printf' was not declared in this scope
   24 |         printf("%06d %06d",P[i],num[i]);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 |
Language: C

#include<stdio.h>

int main(void){
  int N;
  scanf("%d",&N);
  int M;
  scanf("%d",&M);
  int P[N];
  int Y[N];
  for(int j=0;j<M;j++){
    scanf("%d %d",&P[j],&Y[j]);
  };
  for(int k=0;k<M;k++){
    int count=0;
    for(int j=0;j<M;j++){
      if(Y[k] > Y[j] && P[k]==P[j)
	{
	    count++;
	  };
	
    };
 printf("%06d%06d\n",P[k],count+1);
  };
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:16:34: error: expected ']' before ')' token
   16 |       if(Y[k] > Y[j] && P[k]==P[j)
      |                                  ^
      |                                  ]
Language: C++

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    vector<vector<pair<ll,ll>>> p(m,vector<pair<ll,ll>>(0));
    vector<string> id(m);
    for(int i = 0;i < m;i ++){
        ll place,year;
        cin >> place >> year;
        p[place-1].push_back(make_pair(year,i));
    }
    for(int i = 0;i < n;i ++){
        sort(p[i].begin(),p[i].end());
    }
    for(int i = 0;i < n;i ++){
        for(int j = 0;j < p[i].size();j ++){
            string a,b;
            ostringstream ss;
	        ss << setw(6) << setfill('0') << to_string(i+1);
            if(i/100000==0)a(ss.str());
            else a = to_string(i+1);
            ostringstream sl;
	        sl << setw(6) << setfill('0') << to_string(j+1);
	        if(j/100000==0)b(sl.str());
            else b = to_string(j+1);
            id[p[i][j].second] = a + b;
        }
    }
    for(int i = 0;i < m;i ++){
        cout << id[i] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:29: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (std::__cxx11::basic_ostringstream<char>::__string_type)'
   25 |             if(i/100000==0)a(ss.str());
      |                            ~^~~~~~~~~~
a.cc:29:33: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (std::__cxx11::basic_ostringstream<char>::__string_type)'
   29 |                 if(j/100000==0)b(sl.str());
      |                                ~^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;


unsigned geddigit(unsigned num){
  unsigned digit = 0;
  if(num == 0){
    return 0;
  } else {
    while(num != 0){
      num /= 10;
      digit++;
  }
  return digit;
}

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

  int p[m], y[m];
  for(int i = 0; i < m; i++){
    cin >> p[i] >> y[i];
  }

  int count[n];
  for(int i = 0; i < m; i++){
    count[i] = 1;
  }

  int true_digit_1 = 0;
  int true_digit_2 = 0;

  for(int i = 0; i < m; i++){
    for(int j = i + 1; j < m; j++){
      if(p[i] == p[j]){
        if(y[i] > y[j]){
          count[i]++;
        } else {
          count[j]++;
        }
      }
      true_digit_1 = 6 - geddigit(p[i]);
      true_digit_2 = 6 - geddigit(count[i]);
    }

    for(int k = 0; k < true_digit_1; k++){
      cout << 0;
    }
    cout << p[i];

    for(int k = 0; k < true_digit_2; k++){
      cout << 0;
    }
    cout << count[i];

    cout << " ";
  }
}

Compiler output:
a.cc: In function 'unsigned int geddigit(unsigned int)':
a.cc:21:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   21 | int main(){
      |         ^~
a.cc:21:9: note: remove parentheses to default-initialize a variable
   21 | int main(){
      |         ^~
      |         --
a.cc:21:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:21:11: error: a function-definition is not allowed here before '{' token
   21 | int main(){
      |           ^
a.cc:62:2: error: expected '}' at end of input
   62 | }
      |  ^
a.cc:9:32: note: to match this '{'
    9 | unsigned geddigit(unsigned num){
      |                                ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
 
int main(){
  float t,a,m;
 int f,n,i;
  scanf("%d %f %f",&n,&t,&a);
  float h[n];
  float x[n];
  m=50000;
  for (i=0;i<n;i++){
    scanf("%f",&h[i]);
    x[i]=faabs(t-h[i]*0.006-a);

  }
  
  for (i=0;i<n;i++){
    if(m>x[i]){
      m=x[i];
    f=i;}
    
  }
  
  printf("%d",f+1);
  
}


Compiler output:
main.c: In function 'main':
main.c:14:10: error: implicit declaration of function 'faabs'; did you mean 'fabs'? [-Wimplicit-function-declaration]
   14 |     x[i]=faabs(t-h[i]*0.006-a);
      |          ^~~~~
      |          fabs
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <utility>

using namespace std;

typedef pair<int, int> pii;
typedef vector<pii> vp;

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

    vp yi[n];
    for (int i = 0; i < m; i++) {
        int p, y;
        cin >> p >> y;
        yi[p-1].push_back(pii(y, i));
    }

    pii id[m];
    for (int i = 0; i < n; i++) {
        sort(yi[i].begin(), yi[i].end());
        for (int j = 0; j < yi[i].size(); j++) {
            id[yi[i][j].second] = pii(i, j);
        }
    }

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

    return 0;
}

Compiler output:
a.cc:9:9: error: 'vector' does not name a type
    9 | typedef vector<pii> vp;
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:15:5: error: 'vp' was not declared in this scope
   15 |     vp yi[n];
      |     ^~
a.cc:19:9: error: 'yi' was not declared in this scope; did you mean 'y'?
   19 |         yi[p-1].push_back(pii(y, i));
      |         ^~
      |         y
a.cc:24:14: error: 'yi' was not declared in this scope; did you mean 'i'?
   24 |         sort(yi[i].begin(), yi[i].end());
      |              ^~
      |              i
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
 
int main(){
  float t,a,m;
 int f,n,i;
  scanf("%d %f %f",&n,&t,&a);
  float h[n];
  float x[n];
  m=50000;
  for (i=0;i<n;i++){
    scanf("%f",&h[i]);
    x[i]=faabs(t-h[i]*0.006-a);

  }
  
  for (i=0;i<n;i++){
    if(m>x[i]){
      m=x[i];
    f=i;}
    
  }
  
  printf("%d",f+1);
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'faabs' was not declared in this scope; did you mean 'fabs'?
   14 |     x[i]=faabs(t-h[i]*0.006-a);
      |          ^~~~~
      |          fabs
Language: C++

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    vector<vector<pair<ll,ll>>> p(m,vector<pair<ll,ll>>(0));
    vector<string> id(m);
    for(int i = 0;i < m;i ++){
        ll place,year;
        cin >> place >> year;
        p[place-1].push_back(make_pair(year,i));
    }
    for(int i = 0;i < n;i ++){
        sort(p[i].begin(),p[i].end());
    }
    for(int i = 0;i < n;i ++){
        for(int j = 0;j < p[i].size();j ++){
            string a,b;
            ostringstream ss;
	        ss << setw(6) << setfill('0') << to_string(i+1);
            if(i/100000==0)a =idi(ss.str());
            else a = to_string(i+1);
            ostringstream sl;
	        sl << setw(6) << setfill('0') << to_string(j+1);
	        if(j/100000==0)b = idj(sl.str());
            else b = to_string(j+1);
            id[p[i][j].second] = a + b;
        }
    }
    for(int i = 0;i < m;i ++){
        cout << id[i] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:31: error: 'idi' was not declared in this scope; did you mean 'id'?
   25 |             if(i/100000==0)a =idi(ss.str());
      |                               ^~~
      |                               id
a.cc:29:36: error: 'idj' was not declared in this scope; did you mean 'id'?
   29 |                 if(j/100000==0)b = idj(sl.str());
      |                                    ^~~
      |                                    id
Language: C

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int[] P = new int[M];
		int[] Y = new int[M];
		String[] Num = new String[M];
		int[][] table = new int[N][M];
		int[] count = new int[N];
		for (int i = 0; i < M; i++) {
			P[i] = sc.nextInt();
			Y[i] = sc.nextInt();
			table[P[i] - 1][count[P[i] - 1]] = Y[i];
			count[P[i] - 1]++;
		}
		System.out.println("a1");
		for (int i = 0; i < M; i++) {
			Arrays.sort(table[P[i] - 1]);
		}

		for (int i = 0; i < M; i++) {
			int count2 = 0;
			for (int j = 0; j < M; j++) {
				if (table[P[i] - 1][j] != 0) {
					count2++;
					if (table[P[i] - 1][j] == Y[i]) {
						System.out.println(String.format("%06d", P[i]) + String.format("%06d", count2));
					}
				}

			}
		}

	}

}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Arrays;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Arrays;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.Scanner;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.Scanner;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdlib>  // abs() for integer
#include <vector>
#include <ios>     // std::left, std::right
#include <iomanip> // std::setw(int), std::setfill(char)
using namespace std;



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

    int N,M;
    cin >> N >> M;

    int P[M+1], Y[M+1];

    vector<pair<int, int> > pairs(M+1);
    vector<pair<int, int> > original_pairs(M+1);

    pairs[0] = make_pair(-1, -1);
    for(int i=1; i<M+1; i++){
        cin >> P[i] >> Y[i];
        pairs[i] = make_pair(P[i], Y[i]);
        original_pairs[i] = make_pair(P[i], Y[i]);
    }

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

    for(int i=1; i<M+1; i++){
        //　何番か求める
        int num = 0;
        int j=0;

        for(int tmp=1; tmp<M+1; tmp++){
            if(pairs[tmp].first == original_pairs[i].first && pairs[tmp].second == original_pairs[i].second){
                j=tmp;
                break;
            }
        }

        for(int k=1; k<=j; k++){
            if(pairs[k].first == pairs[j].first){
                num++;
            }
        }

        cout  <<swet(6)<<setfill('0') << P[i] << <<swet(6)<<setfill('0') << num << '\n';
    }




}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:17: error: 'swet' was not declared in this scope
   50 |         cout  <<swet(6)<<setfill('0') << P[i] << <<swet(6)<<setfill('0') << num << '\n';
      |                 ^~~~
a.cc:50:50: error: expected primary-expression before '<<' token
   50 |         cout  <<swet(6)<<setfill('0') << P[i] << <<swet(6)<<setfill('0') << num << '\n';
      |                                                  ^~
Language: C++

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    vector<vector<pair<ll,ll>>> p(m,vector<pair<ll,ll>>(0));
    vector<string> id(m);
    for(int i = 0;i < m;i ++){
        ll place,year;
        cin >> place >> year;
        p[place-1].push_back(make_pair(year,i));
    }
    for(int i = 0;i < n;i ++){
        sort(p[i].begin(),p[i].end());
    }
    for(int i = 0;i < n;i ++){
        for(int j = 0;j < p[i].size();j ++){
            ostringstream ss;
	        ss << setw(6) << setfill('0') << to_string(i+1);
            if(i/100000==0)string idi(ss.str());
            else string idi = to_string(i+1);
            ostringstream sl;
	        sl << setw(6) << setfill('0') << to_string(j+1);
	        if(j/100000==0)string idj(sl.str());
            else string idi = to_string(j+1);
            id[p[i][j].second] = idi + idj;
        }
    }
    for(int i = 0;i < m;i ++){
        cout << id[i] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:34: error: 'idi' was not declared in this scope; did you mean 'id'?
   30 |             id[p[i][j].second] = idi + idj;
      |                                  ^~~
      |                                  id
a.cc:30:40: error: 'idj' was not declared in this scope; did you mean 'id'?
   30 |             id[p[i][j].second] = idi + idj;
      |                                        ^~~
      |                                        id
Language: C++

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

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N, M;
	cin >> N >> M;
	vector<int> P(M), Y(M);
	for (int i = 0; i < M; i++) {
		cin >> P.at(i) >> Y.at(i);
	}
	
	//int j = M - 1;
	//while (j > 0) {
	//	int k = 0;
	//	while (k < j) {
	//		if (Y.at(k) > Y.at(k+1)) {
	//			swap(Y.at(k), Y.at(k+1));
	//			swap(P.at(k), P.at(k+1));
	//		}
	//		k = k + 1;
	//	}
	//	j = j - 1;
	//}
	
	for (int i = 0; i < N; i++) {
		
	
	for (int i = 0; i < M; i++) {
		cout.width(6);
		cout.fill('0');
		cout << P.at(i);
		
		cout.width(6);
		cout.fill('0');
		cout << Y.at(i) << endl;
		
	}
}


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

#include <iostream>
#include <cstdlib>  // abs() for integer
#include <vector>
#include <ios>     // std::left, std::right
#include <iomanip> // std::setw(int), std::setfill(char)
using namespace std;



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

    int N,M;
    cin >> N >> M;

    int P[M+1], Y[M+1];

    vector<pair<int, int> > pairs(M+1);
    vector<pair<int, int> > original_pairs(M+1);

    pairs[0] = make_pair(-1, -1);
    for(int i=1; i<M+1; i++){
        cin >> P[i] >> Y[i];
        pairs[i] = make_pair(P[i], Y[i]);
        original_pairs[i] = make_pair(P[i], Y[i]);
    }

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

    for(int i=1; i<M+1; i++){
        //　何番か求める
        int num = 0;
        int j=0;

        for(int tmp=1; tmp<M+1; tmp++){
            if(pairs[tmp].first == original_pairs[i].first && pairs[tmp].second == original_pairs[i].second){
                j=tmp;
                break;
            }
        }

        for(int k=1; k<=j; k++){
            if(pairs[k].first == pairs[j].first){
                num++;
            }
        }

        cout  << std::setfill('0') << std::right << std::setw(6) << P[i] << std::setfill('0') << std::right << std::setw(6) << num << '\n';
    }




}

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

#include<iostream>
#include<stdio.h>
using namespace std;
z
int main(){
  int n,m;
  cin >> n >> m;
  int p[m] , y[m];
  for (int i = 0; i<m; i++){
    cin >> p[i] >> y[i];
  }

  int number[m];

  for (int j =0 ; j<m; j++){
    number[j] = 1;
    for (int s = 0; p[j]==p[s] && s<m; s++){
      if (y[s] < y[j]){
        number[j] = number[j] +1;
      }
    }
  }

  for (int i =0;i<m; i++){
    printf("%06d", p[i]);
    printf("%06d\n", number[i]);
  }
}


Compiler output:
a.cc:4:1: error: 'z' does not name a type
    4 | z
      | ^
Language: C

#include <iostream>
#include <set>
#include <ios>
#include <iomanip>
using namespace std;

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

    struct City {
        int pref;
        int year;
        int x;
    };
    City city[100010];
    set<int> years[100010];

    for (int i = 1; i <= M; i++) {
        int Pi, Yi;
        cin >> Pi >> Yi;
        city[i].pref = Pi, city[i].year = Yi;
        years[Pi].insert(Yi);
    }

    for (int i = 1; i <= M; i++) {
        city[i].x = distance(years[city[i].pref].begin(), years[city[i].pref].find(city[i].year)) + 1;

        cout << setfill('0') << right << setw(6) << city[i].pref;
        cout << setfill('0') << right << setw(6) << city[i].x;
        cout << endl;
    }
}

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

#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <vector>
using namespace std;
int main()
{
    int n, m, y[100000], p[100000];
    
    cin >> n >> m;
    for (int i = 0; i < m; i++) cin >> p[i] >> y[i];
    
    
    for (int i = 0; i < m; i++) {
        vector<int> v;
        for (int j = 0; j < m; j++) {
            if (p[j] == p[i])
                v.push_back(y[j]);
        }
        sort(v.begin(), v.end());
        int count = 0;
        
        for (int j = 0; j < v.size(); j++) {
            if (v[j] == y[i]) {
                count = j;
                braek;
            }
        }
        
        cout << setfill('0') << setw(6) << p[i] << setfill('0') << setw(6) << count + 1 << endl;
    }
        
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'braek' was not declared in this scope
   28 |                 braek;
      |                 ^~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, m;
    vector<int> p;
    vector<int> y;
    
    int i, j;
    int a, b;

    scanf("%d %d", &n, &m);
    for (i = 0; i < m; i++) {
        scanf("%d %d", &a, &b);

        p.push_back(a);
        y.push_back(b);
    }

    cout << "OK" << endl;
    
    vector< vector<int> > p_c_yr;
    
    for (i = 0; i < n; i++) {
        vector<int> c_yr;
        for (j = 0; j < m; j ++ ) {
            if (p[j] == i + 1){
                c_yr.push_back(y[j]);
            }
        }
        sort(c_yr.begin(), c_yr.end());
        p_c_yr.push_back(c_yr);
    }

    for (i = 0; i < m; i++) {
        int order = 0;
        for (j = 0; j < m; j++) {
            if (p_c_yr[p[i] - 1][j] == y[i]) {
                order = j + 1;
                break;
            }
        }
        printf("%06d%06d\n", p[i], order);
        
    }
}


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

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <utility>
#include <map>
int needleX[4] = { -1,0,1,0 };
int needleY[4] = { 0,1,0,-1 };

#define const INF=1<<21;
int main(){
	int N,M,ans=0,count=1;
    std::cin >> N >> M;
    std::vector<std::pair<std::pair<int,int>,int>> a(M);
    std::vector<std::pair<int,int> b(M);
    for(int i=0;i<M;++i){
        std::cin >> a[i].first.first >> a[i].first.second;
        a[i].second=i;
    }
    std::sort(a.begin(),a.end());
    for(int i=0;i<M;++i){
        b[a[i].second].first=a[i].first.first;
        b[a[i].second].second=count;
        if(a[i].first.first==a[i+1].first.first&&i!=M-1){
            count++;
        }else{
            count=1;
        }
        
    }
    for(int i=0;i<M;i++){
        printf("%06d",b[i].first);
        printf("%06d",b[i].second);
        std::cout << std::endl;

    }
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:39: error: template argument 1 is invalid
   19 |     std::vector<std::pair<int,int> b(M);
      |                                       ^
a.cc:19:39: error: template argument 2 is invalid
a.cc:26:9: error: 'b' was not declared in this scope
   26 |         b[a[i].second].first=a[i].first.first;
      |         ^
a.cc:36:23: error: 'b' was not declared in this scope
   36 |         printf("%06d",b[i].first);
      |                       ^
Language: C++

#include <stdio.h>
#include <algorithm>

#define N 1000000001

int n, m;
int p[N];
long y[N];

int key[N];
int count[N];
int subscript[N];
char ans[N][13];

int main(int argc, char const *argv[]) {
	int i;

	scanf("%d %d\n", &n, &m);

	for (i = 0; i < m; i++) {
		scanf("%d %d", &p[i], &y[i]);

		key[y[i]] = p[i];
		subscript[y[i]] = i;
	}
	std::sort(y, y+m);

	for (i = 0; i < m; i++) {
		count[key[y[i]]]++;
		sprintf(ans[subscript[y[i]]], "%06d%06d", p[subscript[y[i]]], count[key[y[i]]]);
	}

	for (i = 0; i < m; i++) {
		printf("%s\n", ans[i]);
	}

	return 0;
}


Compiler output:
/tmp/ccaYnfGA.o: in function `main':
a.cc:(.text+0x53): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0x98): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0xc2): relocation truncated to fit: R_X86_64_PC32 against symbol `key' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0xd9): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0xec): relocation truncated to fit: R_X86_64_PC32 against symbol `subscript' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0x11c): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0x129): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0x151): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0x164): relocation truncated to fit: R_X86_64_PC32 against symbol `key' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0x179): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccaYnfGA.o
a.cc:(.text+0x190): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <map>

using namespace std;

typedef map<int, int> INTMAP;

int main(){

    int N;
    int M;

    cin >> N >> M;

    int list[M][3];

    for(int i=0; i<M; i++){
        int city;
        int year;
        cin>>city>>year;
        list[i][0] = city;
        list[i][1] = year;

    }

    for(int i = 0; i < N; i++){
        INTMAP mymap;
        for(int j=0; j<M; j++){
            if(list[j][0] == N){
                mymap.insert(INTMAP::value_type(list[j][1], M));

            }
        }

        if(mymap.empty() == 0){
            INTMAP::const_iterator it;
            int num = 1;
            for(it = mymap.begin; it != mymap.end(); it++){
                list[(*it).second][2] == num;
                num++; 
            }
        }
    }

    for(int i=0; i<M; i++){
        printf("%06d", list[i][0]);
        printf("%06d\n", list[i][2]);
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:28: error: no match for 'operator=' (operand types are 'std::map<int, int>::const_iterator' {aka 'std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::const_iterator'} and '<unresolved overloaded function type>')
   38 |             for(it = mymap.begin; it != mymap.end(); it++){
      |                            ^~~~~
In file included from /usr/include/c++/14/map:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_tree.h:324:12: note: candidate: 'constexpr std::_Rb_tree_const_iterator<std::pair<const int, int> >& std::_Rb_tree_const_iterator<std::pair<const int, int> >::operator=(const std::_Rb_tree_const_iterator<std::pair<const int, int> >&)'
  324 |     struct _Rb_tree_const_iterator
      |            ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_tree.h:324:12: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const std::_Rb_tree_const_iterator<std::pair<const int, int> >&'
/usr/include/c++/14/bits/stl_tree.h:324:12: note: candidate: 'constexpr std::_Rb_tree_const_iterator<std::pair<const int, int> >& std::_Rb_tree_const_iterator<std::pair<const int, int> >::operator=(std::_Rb_tree_const_iterator<std::pair<const int, int> >&&)'
/usr/include/c++/14/bits/stl_tree.h:324:12: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::_Rb_tree_const_iterator<std::pair<const int, int> >&&'
Language: C++

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

using namespace std;
string apz(int n) {
	stringstream ss;
	string ans="";
	int t=n==1?4:5;
	for(int i=t-log10(n); i>=0; --i)ans+='0';
	ss<<n;
	return ans+ss.str();
}
int main() {
	int n, m;
	cin>>n>>m;
	map<int, vector<pair<int, int>>>mp;

	for(int i=0; i<m; ++i) {
		int p, y;
		cin>>p>>y;
		mp[p].push_back({i, y});
	}

	vector<string>ans(m);
	for(auto e:mp) {
		sort(e.second.begin(), e.second.end(),
			[](const pair<int, int>a, const pair<int, int>b) {
			return a.second<b.second;
		});
		for(int i=0; i<e.second.size(); ++i) {
			ans[e.second[i].first]=apz(e.first)+apz(i+1);
		}
	}

	for(auto e:ans)cout<<e<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'std::string apz(int)':
a.cc:13:21: error: 'log10' was not declared in this scope
   13 |         for(int i=t-log10(n); i>=0; --i)ans+='0';
      |                     ^~~~~
Language: C++

#include "pch.h"
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

struct datatype{
	int city, year, citynum, num,bnum;
};

int compdata(const void*a, const void*b)
{
	return ((datatype*)a)->year - ((datatype*)b)->year;
}
int compdata2(const void*a, const void*b)
{
	return ((datatype*)a)->bnum - ((datatype*)b)->bnum;
}

int main()
{
	static int n, m, i,used[100010];
	static datatype data[100010];
	cin >> n >> m;
	for (i = 0; i < m; i++)
	{
		cin >> data[i].city >> data[i].year;
		data[i].bnum = i;
	}
	qsort(data, m, sizeof(datatype), compdata);
	for (i = 0; i < m; i++)
	{
		//printf("%d-%d\n", data[i].city, data[i].year);
	}
	for (i = 0; i < m; i++)
	{
		used[data[i].city]++;
		data[i].citynum = used[data[i].city];
		data[i].num = data[i].city * 1000000 + data[i].citynum;
	}
	qsort(data, m, sizeof(datatype), compdata2);
	for (i = 0; i < m; i++)
	{
		//printf("%d,%d,%d,num=%012d\n", data[i].city, data[i].year, data[i].citynum, data[i].num);
		printf("%012d\n", data[i].num);
	}
}


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

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

int N, M, i, P_tmp, Y_tmp;

int main(void) {
    cin >> N >> M;
    pair<int, int> city[M]; // 第１要素：年, 第２要素：市番号
    int id[M];
    int pref[N];
    for (i=0; i<N; i++) {
        pref[i] = 0;
    }
    int P[M], Y[M];
    
    for (i=0; i<M; i++) {
        cin >> P[i] >> Y[i];
        city[i] = make_pair(Y[i], i);
    }
    sort(city, city + M);
    
//    for (i=0; i<M; i++) {
//        cout << "city[" <<  i << "]=(" << city[i].first << ", " << city[i].second << ")" << endl;
//        cout << "P[" << i << "]=" << P[i] << endl;
//    }
    
    for (i=0; i<M; i++) {
        pref[P[city[i].second] - 1]++;
        id[city[i].second] = pref[P[city[i].second] - 1];
    }
    
    for (i=0; i<M; i++) {
        printf("%06d%06d\n", P[i], id[i]);
    }
    
    
//    for (i=0; i<N; i++) {
//        cout << pref[i] << endl;
//    }
//
//    for (i=0; i<M; i++) {
//        cout << id[i] << endl;
//    }
 
    return 0;
}


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

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

int keta(int n)
{
	int ret=1;
	while(1)
	{
		n/=10;
		if(n!=0)
		{
			ret++;
			continue;
		}
		else{
			break;
		}
	}
	return ret;
}

class ip{
	public:
	int f,s;
	operator<(const ip &rhs)
	{
		return this->s < rhs.s;
	}
	void print()
	{
		string str="";
		int l=6-keta(f+1);
		for(int i=0;i<l;i++)str+="0";
		cout << str;
		cout << f+1;
		str="";
		l=6-keta(s);
		for(int i=0;i<l;i++)str+="0";
		cout << str;
		cout << s;
		cout << endl;
	}
};

int main()
{
	
	int N,M;
	ip tmp;
	vector<vector<ip>> ken;
	vector<ip> ans;
	
	cin >> N >> M;
	int P[M+10],Y[M+10];
	
	ken.resize(N);
	ans.resize(M);
	for(int i=0;i<M;i++)
	{
		cin >> P[i] >> Y[i];
		tmp.f=i;
		tmp.s=Y[i]-1;
		ken[P[i]-1].push_back(tmp);
	}
	
	for(int i=0;i<N;i++)
	{
		sort(ken[i].begin(),ken[i].end());
		int cnt=1;
		for(auto itr=ken[i].begin();itr!=ken[i].end();++itr)
		{
			ans[itr->f].f=i;
			ans[itr->f].s=cnt;
			cnt++;
		}
	}
	for(auto itr=ans.begin();itr!=ans.end();++itr)
	{
		itr->print();
	}
	return 0;
}


Compiler output:
a.cc:27:9: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
   27 |         operator<(const ip &rhs)
      |         ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)

using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

int main() {
	int N,M;
	cin >>N>>M;
	int P[M], Y[M];
	rep(i,0,M) cin >>P[i]>>Y[i];
	tuple<int, int, int> p[M];
	rep(i,0,M) p[i]=make_tuple(P[i],Y[i],i);
	sort(p,p+M);
	int A[M];
	A[get<2>(p[0])]=1;
	rep(i,0,M){
		if(get<0>(p[i])==get<0>(p[i-1])){
			A[get<2>(p[i])]=A[get<2>(p[i-1])]+	1;
		}
		else{
			A[get<2>(p[i])]=1;
		}
	}
	 rep(i,0,M){
		printf(“%06d%06d\n”, P[i], A[i]);
	}
}


Compiler output:
a.cc:28:24: error: extended character “ is not valid in an identifier
   28 |                 printf(“%06d%06d\n”, P[i], A[i]);
      |                        ^
a.cc:28:33: error: stray '\' in program
   28 |                 printf(“%06d%06d\n”, P[i], A[i]);
      |                                 ^
a.cc:28:34: error: extended character ” is not valid in an identifier
   28 |                 printf(“%06d%06d\n”, P[i], A[i]);
      |                                  ^
a.cc: In function 'int main()':
a.cc:28:24: error: '\U0000201c' was not declared in this scope
   28 |                 printf(“%06d%06d\n”, P[i], A[i]);
      |                        ^
a.cc:28:26: error: unable to find numeric literal operator 'operator""d'
   28 |                 printf(“%06d%06d\n”, P[i], A[i]);
      |                          ^~~
a.cc:28:30: error: unable to find numeric literal operator 'operator""d'
   28 |                 printf(“%06d%06d\n”, P[i], A[i]);
      |                              ^~~
Language: C++

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

int main()
{
    int n, m;
    std::cin>>n>>m;

    int p[m], y[m];
    int rank = 1;

    for(int i=0; i<m; i++)
    {
        std::cin>>p[i]>>y[i];
    }

    for(int i=0; i<m; i++)
    {
        for(int j=0; j<m; j++)
        {
            if(p[i] == p[j] &&  y[i] < y[j])
            {
                rank++;
            }
        }

        std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
        rank = 1;
    }


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: 'setfill' was not declared in this scope; did you mean 'ceill'?
   29 |         std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
      |                    ^~~~~~~
      |                    ceill
a.cc:29:34: error: 'setw' was not declared in this scope; did you mean 'getw'?
   29 |         std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
      |                                  ^~~~
      |                                  getw
Language: C++

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

int main()
{
    int n, m;
    std::cin>>n>>m;

    int p[m], y[m];
    int rank = 1;

    for(int i=0; i<m; i++)
    {
        std::cin>>p[i]>>y[i];
    }

    for(int i=0; i<m; i++)
    {
        for(int j=0; j<m; j++)
        {
            if(p[i] == p[j] &&  y[i] < y[j])
            {
                rank++;
            }
        }

        std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
        rank = 1;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: 'setfill' was not declared in this scope; did you mean 'ceill'?
   29 |         std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
      |                    ^~~~~~~
      |                    ceill
a.cc:29:34: error: 'setw' was not declared in this scope; did you mean 'getw'?
   29 |         std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
      |                                  ^~~~
      |                                  getw
Language: C++

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

int main()
{
    int n, m;
    std::cin>>n>>m;
    std::vector<int> p;
    std::vector<int> y;
    std::vector<pair<int, int>> py;

    int p[m], y[m];
    int rank = 1;

    for(int i=0; i<m; i++)
    {
        std::cin>>p[i]>>y[i];
    }

    for(int i=0; i<m; i++)
    {
        for(int j=0; j<m; j++)
        {
            if(p[i] == p[j] &&  y[i] < y[j])
            {
                rank++;
            }
        }

        std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
        rank = 1;
    }




    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
   12 |     std::vector<pair<int, int>> py;
      |                 ^~~~
      |                 std::pair
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:3013:12: note: 'std::pair' declared here
 3013 |     struct pair;
      |            ^~~~
a.cc:12:30: error: template argument 1 is invalid
   12 |     std::vector<pair<int, int>> py;
      |                              ^~
a.cc:12:30: error: template argument 2 is invalid
a.cc:14:9: error: conflicting declaration 'int p [m]'
   14 |     int p[m], y[m];
      |         ^
a.cc:10:22: note: previous declaration as 'std::vector<int> p'
   10 |     std::vector<int> p;
      |                      ^
a.cc:14:15: error: conflicting declaration 'int y [m]'
   14 |     int p[m], y[m];
      |               ^
a.cc:11:22: note: previous declaration as 'std::vector<int> y'
   11 |     std::vector<int> y;
      |                      ^
a.cc:32:20: error: 'setfill' was not declared in this scope; did you mean 'ceill'?
   32 |         std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
      |                    ^~~~~~~
      |                    ceill
a.cc:32:34: error: 'setw' was not declared in this scope; did you mean 'getw'?
   32 |         std::cout<<setfill("0")<<setw(6)<<p[i]/100000<<setfill("0")<<setw(6)<<rank/100000<<"\n";
      |                                  ^~~~
      |                                  getw
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
struct ss{
	int rank;
    int p;
    int y;
}a[100005];
cmp(ss x,ss y){
    if(x.p!=y.p) return x.p<y.p;
    else return x.y<y.y;
}
int main()
{
    int n ,m;
    scanf("%d%d",&n,&m);
    int b[100005];
    for(int i=0;i<m;i++){
    	a[i].rank=i;
        scanf("%d%d",&a[i].p,&a[i].y); 	
        b[i]=a[i].p;
	}
    sort(a,a+m,cmp);
    int f=a[0].p,flag=1;
    int x[100005];
    
    for(int i=0;i<m;i++){
    	if(a[i].p!=f) {flag=1;f=a[i].p;}
    	x[a[i].rank]=flag++;
	}
    // for(int i=0;i<m;i++)
    //    cout<< a[i].rank<<" "<<a[i].p<<" " <<a[i].y<<endl;
    for(int i=0;i<m;i++)
        printf("%06d%06d\n",b[i],x[i]);
    return 0;
}


Compiler output:
a.cc:9:1: error: ISO C++ forbids declaration of 'cmp' with no type [-fpermissive]
    9 | cmp(ss x,ss y){
      | ^~~
Language: C++

#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
#include <tuple>
#include <string>
using namespace std;
#define ll int64_t
const long MOD = 1e9 + 7;
const long LINF = 1e13;
const long LLINF = 1e18;

template <class T>
void Swap(T& r, T& l) {
  T tmp = r;
  r = l;
  l = tmp;
}



int main() {

  long n, m;
  cin >> n >> m;
  vector<long>p(m);
  vector<long>y(m);
  vector<tuple<long, long, long>> npy(m);//前からイテレータ,所属市、年

  for (long i = 0; i < m; ++i){
    cin >> p[i] >> y[i];
    npy[i] = make_tuple(i , p[i], y[i]);
  }


  sort(npy.begin(), npy.end(), [](tuple<long, long, long> &l, tuple<long, long, long>&r) {
    return get<2>(l) < get<2>(r);
  });

  vector<long> ken(n+1,0)
  // long ken[1000001];
  // for (long i = 0; i < n+1; ++i){
  //   ken[i] = 1;
  // }
  vector<string> ans(m);



  for (long i = 0; i < m; ++i) {
    // cerr << get<0>(npy[i]) << " : " << get<1>(npy[i]) << " : " <<  get<2>(npy[i]) << endl;

    ostringstream sout;
    sout << setfill('0') << setw(6) << get<1>(npy[i]);
    string pref = sout.str();

    ostringstream sout2;
    sout2 << setfill('0') << setw(6) << (ken[ get<1>(npy[i]) ] + 1 );
    string num = sout2.str();

    ans[ get<0>(npy[i]) ] =  pref + num;

    ken[ get<1>(npy[i]) ]+=1;
  }



  for (long i = 0; i < m; ++i) {
    cout << ans[i] << endl;
  }

}




























Compiler output:
a.cc: In function 'int main()':
a.cc:68:3: error: expected ',' or ';' before 'vector'
   68 |   vector<string> ans(m);
      |   ^~~~~~
a.cc:83:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   83 |     ans[ get<0>(npy[i]) ] =  pref + num;
      |     ^~~
      |     abs
a.cc:91:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   91 |     cout << ans[i] << endl;
      |             ^~~
      |             abs
Language: C++

n, m = map(int, input().split())
ps = []
for i in range(m):
    p, y = map(int, input().split())
    ps.append([p, y, i+1])

ps = sorted(ps)
ps

ans = []
count = 1
for i in range(m):
    if (i != 0 and (ps[i])[0] != (ps[i-1])[0]):
        count = 1
    else:
        pass
    ans.append([(ps[i])[2], 1000000*((ps[i])[0]) + count])
    count += 1

ans = sorted(ans)

for i in ans:
    aw = i[1]
    aww = str(aw).zfill(12)
    print(aww)

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

#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int n, m;
//char maze[101][101];
typedef pair < int, int> P;
//int sx, sy, gx, gy;
//int d[101][101];
//int dx[4] = { 1,0,-1,0 };
//int dy[4] = { 1,0,-1,0 };

//const ll mod = 1000000007;

int main()
{
	int a, b;
	cin >> n>>m;
	vector<P> city(m);
	vector<int> help(m);
	for (int i = 0; i < m; i++) {
		cin >> city[i].first>>city[i].second;
		help[i] = city[i].second;
	}
	sort(help.begin(), help.end());
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < m; j++) {
			//cout << help[j] << " " << city[i].second << endl;
			if (help[j] == int(city[i].second)) {
				printf_s("%06d", int(city[i].first));
				printf_s("%06d\n", j+1);
				break;
			}
		}
		//cout << "work" << endl;
	}
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:33: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   53 |                                 printf_s("%06d", int(city[i].first));
      |                                 ^~~~~~~~
      |                                 printf
Language: C++

if __name__ == '__main__':
    _, m = map(int, input().split())
    pres = [[i] + [int(s) for s in input().split()] for i in range(m)]
    pres.sort(key=lambda t: t[2])
    count = dict((p, 1) for _, p, _ in pres)
    prev_y = 0
    addrs = []
    for i, p, _ in pres:
        addrs.append((i, p * 1000000 + count[p]))
        count[p] += 1
    addrs.sort(key=lambda t: t[0])
    for _, a in addrs:
        print("%012d" % a)


Compiler output:
a.cc:1:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    1 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before 'if'
    1 | if __name__ == '__main__':
      | ^~
Language: C++

#include<cstdio>
#include <stdio.h>
#include <stdlib.h>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<sstream>
#include<iterator>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<list>
using namespace std;
const double eps = 1e-8;
typedef long long LL;
const int M=100005;
int n,m;
struct node
{
	int p,y;
	int id;
	string s;
}a[M];
bool cmp(node x,node z)
{
	if(x.p==z.p)
	{
		return x.y<=z.y;
	}
	return x.p<=z.p;
}
bool cmp1(node x,node z)
{
	
	return x.id<=z.id;
}
int f(int a)   
{  
    int n=0;  
    while (a)  
    {  
        a = a / 10;  
        n++;  
    }  
    return n;  

}  
int main()
{
    
    scanf("%d%d",&m,&n);
    for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&a[i].p,&a[i].y);   
		a[i].id=i;
	}
	sort(a+1,a+n+1,cmp);
	int k=1;
	int t=1;
    for(int i=1;i<=n;i++)
	{
	  if(k==a[i].p)
	  {
	    int num=6-f(i);
	    
	  	for(int j=1;j<=num;j++)
		{
			a[i].s+="0";
			//cout<<"0";
		}
		char s1[10];
		itoa(k,s1,10);
		a[i].s+=s1;
		
		
		num=6-f(a[i].y);
	  	for(int j=1;j<=num;j++)
		{
			a[i].s+="0";
		}
		itoa(t,s1,10);
		a[i].s+=s1;
		 t++;
	  }
	  else
	  	{
		t=1;
		k++;
		i--;
	  	}
	}
	sort(a+1,a+n+1,cmp1);
	for(int i=1;i<=n;i++)
		cout<<a[i].s<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:17: error: 'itoa' was not declared in this scope
   79 |                 itoa(k,s1,10);
      |                 ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
struct ss{
	int rank;
    int p;
    int y;
}a[100005];
cmp(ss x,ss y){
    if(x.p!=y.p) return x.p<y.p;
    else return x.y<y.y;
}
int main()
{
    int n ,m;
    cin >> n >> m;
    int b[100005];
    for(int i=0;i<m;i++){
    	a[i].rank=i;
        cin >> a[i].p>>a[i].y;	
        b[i]=a[i].p;
	}
    sort(a,a+m,cmp);
    int f=a[0].p,flag=1;
    int x[100005];
    
    for(int i=0;i<m;i++){
    	if(a[i].p!=f) {flag=1;f=a[i].p;}
    	x[a[i].rank]=flag++;
	}
    // for(int i=0;i<m;i++)
    //    cout<< a[i].rank<<" "<<a[i].p<<" " <<a[i].y<<endl;
    for(int i=0;i<m;i++)
        printf("%06d%06d\n",b[i],x[i]);
    return 0;
}


Compiler output:
a.cc:10:1: error: ISO C++ forbids declaration of 'cmp' with no type [-fpermissive]
   10 | cmp(ss x,ss y){
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
int N ,M;
vector<int> Y,id,count;
vector<pair<pair<int,int>,int>> P;
typedef pair<pair<int,int>,int> tp;

bool pair_sort_s(const tp& f, const tp& s) {
	return f.second < s.second;
}
bool pair_sort_f_s(const tp& f, const tp& s) {
	return f.first.second < s.first.second;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N >> M;
	REP(i, M) {
		int p, y;
		cin >> p >> y;
		id.push_back(0);
		ps.push_back(p);
		P.push_back(make_pair(make_pair(p, i), y));
	}
	sort ( P.begin(), P.end(), pair_sort_s);

	REP(i, N) {
		int cnt = 1;
		REP(j, M) {
			if (i + 1 == P[j].first.first) {
				id[P[j].first.second] = cnt++;
			}
		}
	}
	REP(i, M) {
		printf("%06d%06d\n", ps[i], id[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'ps' was not declared in this scope; did you mean 'p'?
   25 |                 ps.push_back(p);
      |                 ^~
      |                 p
a.cc:39:38: error: 'ps' was not declared in this scope
   39 |                 printf("%06d%06d\n", ps[i], id[i]);
      |                                      ^~