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

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

string id(int p, int y){
  string ps = to_string(p);
  string ys = to_string(y);
  if(ps.size() < 6) ps = string("000000",6 - ps.size()) + ps;
  if(ys.size() < 6) ys = string("000000",6 - ys.size()) + ys;
  return ps + ys;
}

int main(){
  int n, m; cin >> n >> m;
  vector<tuple<int, int, int>> v(m);
  map<int, vector<int>> mp;

  for(int i = 0; i < m; ++i){
    int a,b; cin >> a >> b;
    v[i] = make_tuple(i, a, b);
    mp[a].push_back(b);
  }

  for(int i = 1; i <= n; ++i)
    if(mp.count(i) != 0) sort(mp[a].begin(), mp[a].end());

  for(int i = 0; i < m; ++i){
    int p = get<1>(v[i]);
    int y = get<2>(v[i]);
    int x = lower_bound(mp[p].begin(), mp[p].end(), y) - mp[p].begin();
    x++;
    cout << id(p, x) << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:34: error: 'a' was not declared in this scope
   24 |     if(mp.count(i) != 0) sort(mp[a].begin(), mp[a].end());
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using p = pair<int,int>;
int main(){
	int n,m;
	cin >> n >> m;
	auto x = vector<vector<p>>(n+1); 
	for (int i = 0; i < m; i++)
	{
		int p,y;
		cin >> p >> y;
		x[p-1].push_back(make_pair(y,i));
	}

	for (int i = 0; i < n; i++)
	{
		sort(x[i].begin(),x[i].end());
	}
	/*
	auto v = vector<p>(n+1,make_pair(0,0));
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < x[i].size(); j++)
		{
			v[x[i][j].second] = make_pair(i,j);
		}
		
	}
	*/
	for (int i = 0;i<m;i++)
	{
		cout << std::setfill('0') << std::right << std::setw(6)<<v[i].first+1;
      	cout << std::setfill('0') << std::right << std::setw(6)<<v[i].second+1<<endl;;
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:74: error: 'v' was not declared in this scope
   32 |                 cout << std::setfill('0') << std::right << std::setw(6)<<v[i].first+1;
      |                                                                          ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>

typedef unsigned long long ULL;
typedef long long LL;

using namespace std;

typedef struct{
    int num;
    int year;
    int prefecture;
    int city_num;

}CITY;
bool sort_state(CITY a, CITY b){
    if( a.year < b.year  || ( a.year == b.year && a.prefecture < b.prefecture) ){
        return true;
    }else{
        return false;
    }
}
bool sort_yaer( CITY a, CITY b){
    if( a.year < b.year ){
        return true;
    }else{
        return false;
    }
}
bool sort_prefectre( CITY a, CITY b){
    if( a.prefecture < b.prefecture){
        return true;
    }else{
        return false;
    }
}
bool sort_num(CITY a, CITY b){
    if( a.num < b.num){
        return true;
    }else{
        return false;
    }
}
int main(){
    int i;
    int N,M;
    int p,y;

    int id_pre, id_num;
    CITY *city;

    cin >> N >> M;

    city = new CITY[M];

    for(i=0;i<M;i++){
        cin >> p >> y;
        city[i].num = i;
        city[i].prefecture = p;
        city[i].year = y;
    }
    sort(city,city+M,sort_year);
    stable_sort(city,city+M,sort_prefectre);
    id_pre = -1;
    id_num = -1;
    for(i=0;i<M;i++){
        if( id_pre !=  city[i].prefecture ){
            id_pre = city[i].prefecture;
            id_num = 1;
        }else{
            id_num++;
        }
        city[i].city_num = id_num;
        //sprintf(city[i].id,"%06d%06d",id_pre,id_num);
    }
    sort(city,city+M,sort_num);
    for(i=0;i<M;i++){
        printf("%06d%06d\n",city[i].prefecture,city[i].city_num);
    }
    
    return 0;
}


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

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

int main(){
  /*
  using P = pair<int, int>;
  using Q = priority_queue<int, vector<int>, greater<int>>;
  int N, M;
  cin >> N >> M;
  queue<P> que;
  vector<Q> vec(100100, Q)
  rep(i, N){
    int P, Y;
    que.push(make_pair(P, Y));
    vec.at(P).push(Y);
  }
  */
  
  int N , M;
  int P[100000] , Y[100000];
  vector<int> yd[100001];
  
  scanf ("% d % d " ,&N ,& M );
  rep (i , M ) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
  rep (i , N ) sort ( yd [ i +1]. begin () , yd [ i +1]. end ());
  rep (i , M ) printf ("%012 lld \ n " , ll ( P [ i ])*1000000+ int ( lower_bound ( yd [ P [ i ]].
begin () , yd [ P [ i ]]. end () , Y [ i ]) - yd [ P [ i ]]. begin ())+1);
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: warning: unknown escape sequence: '\040'
   27 |   rep (i , M ) printf ("%012 lld \ n " , ll ( P [ i ])*1000000+ int ( lower_bound ( yd [ P [ i ]].
      |                        ^~~~~~~~~~~~~~~
a.cc:27:42: error: 'll' was not declared in this scope
   27 |   rep (i , M ) printf ("%012 lld \ n " , ll ( P [ i ])*1000000+ int ( lower_bound ( yd [ P [ i ]].
      |                                          ^~
Language: C++

#include <algorithm>
#include <cstdio>
#include <vector>
using namespace std;
typedef long long ll;
#define rep (i, n) for (int i = 0; i < n; i++)
int N, M;
int P[100000], Y[100000];
vector<int> yd[100001];
int main() {
    scanf("%d %d", &N, &M);
    rep(i, M)
        scanf("% d % d ", &P[i], &Y[i]),
        yd[P[i]].push_back(Y[i]);
    rep(i, N)
        sort(yd[i + 1].begin(), yd[i + 1].end());
    rep(i, M)
        printf("%012 lld \ n ", ll(P[i]) * 1000000 + int(lower_bound(yd[P[i]].begin(), yd[P[i]].end(), Y[i]) - yd[P[i]].begin()) + 1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'i' was not declared in this scope
    6 | #define rep (i, n) for (int i = 0; i < n; i++)
      |              ^
a.cc:12:5: note: in expansion of macro 'rep'
   12 |     rep(i, M)
      |     ^~~
a.cc:6:17: error: 'n' was not declared in this scope
    6 | #define rep (i, n) for (int i = 0; i < n; i++)
      |                 ^
a.cc:12:5: note: in expansion of macro 'rep'
   12 |     rep(i, M)
      |     ^~~
Language: C++

# include < cstdio >
# include < vector >
# include < algorithm >
using namespace std ;
typedef long long ll ;
# define rep (i , n ) for ( int i =0; i < n ; i ++)
int N , M ;
int P [100000] , Y [100000];
vector < int > yd [100001];
int main ()
{
scanf ("% d % d " ,&N ,& M );
rep (i , M ) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
rep (i , N ) sort ( yd [ i +1]. begin () , yd [ i +1]. end ());
rep (i , M ) printf ("%012 lld \ n " , ll ( P [ i ])*1000000+ int ( lower_bound ( yd [ P [ i ]].begin () , yd [ P [ i ]]. end () , Y [ i ]) - yd [ P [ i ]]. begin ())+1);
}

Compiler output:
a.cc:1:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.
Language: C++

#include "ABC113.h"
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>

using namespace std;

void ABC113C()
{
	string str1, str2;
	cin >> str1 >> str2;

	int N = stoi(str1);
	int M = stoi(str2);

	std::vector<std::vector<int> > yearVec(N);
	std::vector<int> pVec(M);
	std::vector<int> yVec(M);
	for (int i = 0; i < M; ++i)
	{
		cin >> str1 >> str2;
		int p = stoi(str1);
		int y = stoi(str2);
		pVec[i] = p;
		yVec[i] = y;
		yearVec[p-1].push_back(y);
	}
	for (int i = 0; i < N; ++i)
	{
		sort(yearVec[i].begin(), yearVec[i].end());
	}

	for (int i = 0; i < M; ++i)
	{
		int p = pVec[i];
		int yOrder = std::distance(yearVec[p-1].cbegin(), std::lower_bound(yearVec[p-1].cbegin(), yearVec[p-1].cend(), yVec[i])) + 1;
		stringstream ss;
		ss << setw(6) << setfill('0') << p << setw(6) << setfill('0') << yOrder;
		cout << ss.str() << endl;
	}

}

int main()
{
	ABC113C();
	return 0;
}


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

#include <stdio.h>

int main(){
  int n,m,
      list[100000][3],
      i,j,k,
      t[100000],
      count,ind,tmp,
      sum;
  
  scanf("%d%d", &n, &m);
  
  for(i=0;i<m;i++){
    scanf("%d%d", &list[i][0], &list[i][1]);
    list[i][2] = 0;
  }
  
  for(i=0;i<m;i++){
    if(list[i][2] == 0){
      li = list[i][0];
      count = 0;
      for(j=0;j<m;j++){
        if(list[j][0] == li){
          t[count] = j;
          count++;
        }
      }
      for(j=0;j<count;j++){
        ind = j;
        indv = list[t[j]][1];
        for(k=j+1;k<count;k++){
          if(list[t[k]][1] < indv){
            ind = k;
            indv = list[t[ind]][1];
          }
        }
        tmp= t[j];
        t[j] = t[ind];
        t[ind] = tmp;
      }
      for(j=0;j<count;j++){
        list[t[j]][2] = j+1;
      }
    }
  }
  
  for(i=0;i<m;i++){
    printf("%06d%06d\n", list[i][0], list[i][2]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:7: error: 'li' undeclared (first use in this function); did you mean 'i'?
   20 |       li = list[i][0];
      |       ^~
      |       i
main.c:20:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:9: error: 'indv' undeclared (first use in this function); did you mean 'ind'?
   30 |         indv = list[t[j]][1];
      |         ^~~~
      |         ind
Language: C

include <stdio.h>

int main(){
  int n,m,
      list[100000][3],
      i,j,k,
      t[100000],
      count,ind,tmp,
      sum;
  
  scanf("%d%d", &n, &m);
  
  for(i=0;i<m;i++){
    scanf("%d%d", &list[i][0], &list[i][1]);
    list[i][2] = 0;
  }
  
  for(i=0;i<m;i++){
    if(list[i][2] == 0){
      count = 0;
      for(j=0;j<m;j++){
        if(list[j][0] == list[i][0]){
          t[count] = j;
          count++;
        }
      }
      for(j=0;j<count;j++){
        ind = j;
        for(k=j+1;k<count;k++){
          if(list[t[k]][1] < list[t[ind]][1]){
            ind = k;
          }
        }
        tmp= t[j];
        t[j] = t[ind];
        t[ind] = tmp;
      }
      for(j=0;j<count;j++){
        list[t[j]][2] = j+1;
      }
    }
  }
  
  for(i=0;i<m;i++){
    printf("%06d%06d\n", list[i][0], list[i][2]);
  }
  return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include <stdio.h>

int main(){
  int n,m,
      list[100000][3],
      ta,tb,
      i,
      sum;
  
  scanf("%d%d", &n, &m);
  
  for(i=0;i<m;i++){
    scanf("%d%d", &list[i][0], &list[i][1]);
  }
  
  for(i=0;i<m;i++){
    ta = list[i][0];
    tb = list[i][1];
    sum = 1;
    for(j=0;j<m;j++){
      if((list[j][0] == ta) && (list[j][1] < tb)){
        sum++;
      }
    }
    list[i][2] = sum;
  }
  
  for(i=0;i<m;i++){
    printf("%06d%06d\n", list[i][0], list[i][2]);
  }
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: 'j' undeclared (first use in this function)
   20 |     for(j=0;j<m;j++){
      |         ^
main.c:20:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
  int n,m,
      list[100000][3],
      ta,tb,
      i,
      sum;
  
  scanf("%d%d", &n, &m);
  
  for(i=0;i<m;i++){
    scanf("%d%d", &list[i][0], &list[i][1]);
  }
  
  for(i=0;i<m;i++){
    ta = list[i][0];
    tb = list[i][1];
    sum = 1;
    for(j=0;j<m;j++){
      if(list[j][0] == ta) && (list[j][1] < tb){
        sum++;
      }
    }
    list[i][2] = sum;
  }
  
  for(i=0;i<m;i++){
    printf("%06d%06d\n", list[i][0], list[i][2]);
  }
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: 'j' undeclared (first use in this function)
   20 |     for(j=0;j<m;j++){
      |         ^
main.c:20:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:31: error: expected identifier before '(' token
   21 |       if(list[j][0] == ta) && (list[j][1] < tb){
      |                               ^
Language: C++

#include <vector>
#include <iostream>
#include <iomanip> 

using namespace std;
int main(){
    int n,m; cin>>n>>m;
    vector<int> P(m),Y(m);
    vector<int> P_Y[m+1];
    for(int i=0;i<m;i++){
        cin >> P[i] >> Y[i];
        P_Y[P[i]].push_back(Y[i]);   
    }

    for(int i=0;i<m+1;i++){
        sort(P_Y[i].begin(),P_Y[i].end());
    }
    //cout << "hoge" <<endl;
    for(int i=0;i<m;i++){
        cout<< setfill('0') << right << setw(12)<<P[i]*1000000 + upper_bound(P_Y[P[i]].begin(),P_Y[P[i]].end(),Y[i]) - P_Y[P[i]].begin() <<endl;
    }

    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |         sort(P_Y[i].begin(),P_Y[i].end());
      |         ^~~~
      |         short
a.cc:20:66: error: 'upper_bound' was not declared in this scope
   20 |         cout<< setfill('0') << right << setw(12)<<P[i]*1000000 + upper_bound(P_Y[P[i]].begin(),P_Y[P[i]].end(),Y[i]) - P_Y[P[i]].begin() <<endl;
      |                                                                  ^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m,x;
  cin>>n>>m;
  vector<int> c(n),d(n);
  vector<int> e(n+1);
  for(int i=0;i<n;i++){
    cin>>c[i]>>d[i];
    e[c[i]].push_back(d[i]);
  }
  for(int i=0;i<n+1;i++){
    sort(e[i].begin(),e[i].end());
  }
  for(int i=0;i<m;i++){
    x=lower_bound(e[c[i]].begin(), e[c[i]].end(), d[i])- e[c[i]].begin() + 1;
    printf("%06d", c[i]);
    printf("%06d\n",x);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: request for member 'push_back' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)c.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   12 |     e[c[i]].push_back(d[i]);
      |             ^~~~~~~~~
a.cc:15:15: error: request for member 'begin' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   15 |     sort(e[i].begin(),e[i].end());
      |               ^~~~~
a.cc:15:28: error: request for member 'end' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   15 |     sort(e[i].begin(),e[i].end());
      |                            ^~~
a.cc:18:27: error: request for member 'begin' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)c.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   18 |     x=lower_bound(e[c[i]].begin(), e[c[i]].end(), d[i])- e[c[i]].begin() + 1;
      |                           ^~~~~
a.cc:18:44: error: request for member 'end' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)c.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   18 |     x=lower_bound(e[c[i]].begin(), e[c[i]].end(), d[i])- e[c[i]].begin() + 1;
      |                                            ^~~
a.cc:18:66: error: request for member 'begin' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)c.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   18 |     x=lower_bound(e[c[i]].begin(), e[c[i]].end(), d[i])- e[c[i]].begin() + 1;
      |                                                                  ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m,x;
  cin>>n>>m;
  int c[n],d[n];
  vector<int> e(n+1);
  for(int i=0;i<n;i++){
    cin>>c[i]>>d[i];
    e[c[i]].push_back(d[i]);
  }
  for(int i=0;i<n+1;i++){
    sort(e[i].begin(),e[i].end());
  }
  for(int i=0;i<m;i++){
    x=lower_bound(e[c[i]].begin(), e[c[i]].end(), d[i])- e[c[i]].begin() + 1;
    printf("%06d", c[i]);
    printf("%06d\n",x);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: request for member 'push_back' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)c[i]))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   12 |     e[c[i]].push_back(d[i]);
      |             ^~~~~~~~~
a.cc:15:15: error: request for member 'begin' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   15 |     sort(e[i].begin(),e[i].end());
      |               ^~~~~
a.cc:15:28: error: request for member 'end' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   15 |     sort(e[i].begin(),e[i].end());
      |                            ^~~
a.cc:18:27: error: request for member 'begin' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)c[i]))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   18 |     x=lower_bound(e[c[i]].begin(), e[c[i]].end(), d[i])- e[c[i]].begin() + 1;
      |                           ^~~~~
a.cc:18:44: error: request for member 'end' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)c[i]))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   18 |     x=lower_bound(e[c[i]].begin(), e[c[i]].end(), d[i])- e[c[i]].begin() + 1;
      |                                            ^~~
a.cc:18:66: error: request for member 'begin' in 'e.std::vector<int>::operator[](((std::vector<int>::size_type)c[i]))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   18 |     x=lower_bound(e[c[i]].begin(), e[c[i]].end(), d[i])- e[c[i]].begin() + 1;
      |                                                                  ^~~~~
Language: C++

#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>


using namespace std;



int main() {
	
	int n, m;
	cin >> n >> m;
	vector<vector<int>>p(100005);
	int w[100005]={};
	int h[100005] = {};
	for (int i = 0; i < m; i++) {

		int t, y;
		cin >> t >> y;
		p[t].push_back(y);
		w[i] = t;
		h[i] = y;
	}
	for (int i = 0; i <= n; i++) {
		sort(p[i].begin(), p[i].end());
	}

	for (int i = 0; i < m; i++) {
		for (int j = 0; j < p[w[i]].size(); j++) {
			if (p[w[i]][j] == h[i]) {
				
					f /= 10;
			
				cout << w[i];
				
					f /= 10;
		
					cout<< j + 1 << endl;
				break;
			}
		}
	}



	return 0;



}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:41: error: 'f' was not declared in this scope
   49 |                                         f /= 10;
      |                                         ^
Language: C++

# include <cstdio >
# include <vector >
# include <algorithm >
using namespace std ;
typedef long long ll;
# define rep (i,n) for (int i=0;i<n;i++)
int N,M;
int P [100000] , Y [100000];
vector <vector<int> > yd [100001];
int main ()
{
scanf ("% d%d",&N ,&M);
rep(i,M) scanf ("%d%d",&P[i],&Y[i]), yd[P[i ]]. push_back (Y[i ]);
rep(i,N) sort (yd[i +1]. begin (), yd[i +1]. end ());
rep(i,M) printf ("%012 lld\n",ll(P[i ])*1000000+ int( lower_bound (yd[P[i]].
begin (), yd[P[i]]. end (),Y[i])- yd[P[i]]. begin ())+1);
}

Compiler output:
a.cc:1:11: fatal error: cstdio : No such file or directory
    1 | # include <cstdio >
      |           ^~~~~~~~~
compilation terminated.
Language: C++

# include <cstdio >
# include <vector >
# include <algorithm >
using namespace std ;
typedef long long ll;
# define rep (i,n) for (int i=0;i<n;i++)
int N,M;
int P [100000] , Y [100000];
vector <int > yd [100001];
int main ()
{
scanf ("% d%d",&N ,&M);
rep(i,M) scanf ("%d%d",&P[i],&Y[i]), yd[P[i ]]. push_back (Y[i ]);
rep(i,N) sort (yd[i +1]. begin (), yd[i +1]. end ());
rep(i,M) printf ("%012 lld\n",ll(P[i ])*1000000+ int( lower_bound (yd[P[i]].
begin (), yd[P[i]]. end (),Y[i])- yd[P[i]]. begin ())+1);
}

Compiler output:
a.cc:1:11: fatal error: cstdio : No such file or directory
    1 | # include <cstdio >
      |           ^~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());
        Shi[] shi = new Shi[m];
        for(int i = 0; i<m; i++) {
            shi[i] = new Shi(Integer.parseInt(sc.next()), Integer.parseInt(sc.nextInt()), i);
        }
        Arrays.sort(shi,(ac, bc)->(ac.b-bc.b));

        int cnt[] = new int[n+1];
        String[] strings = new String[m];

        for(int i = 0; i<m; i++) {
            cnt[shi[i].a]++;
            strings[shi[i].index] = String.format("%06d", shi[i].a) + String.format("%06d", cnt[shi[i].a]);
        }
        for(String s: strings) {
            System.out.println(s);
        }

    }
}
class Shi {
    int a,b,index;
    public Shi(int a, int b, int index) {
        this.a = a;
        this.b = b;
        this.index = index;
    }
}

Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to String
            shi[i] = new Shi(Integer.parseInt(sc.next()), Integer.parseInt(sc.nextInt()), i);
                                                                                     ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		Comparator<int[]> comparator_0 = new Comparator<int[]>() {
		    @Override
		    public int compare(int[] o1, int[] o2) {
		        return Integer.compare(o1[0], o2[0]);
		    }
		};
		Comparator<int[]> comparator_1 = new Comparator<int[]>() {
		    @Override
		    public int compare(int[] o1, int[] o2) {
		        return Integer.compare(o1[1], o2[1]);
		    }
		};
		Comparator<int[]> comparator_2 = new Comparator<int[]>() {
		    @Override
		    public int compare(int[] o1, int[] o2) {
		        return Integer.compare(o1[2], o2[2]);
		    }
		};
		LiskedList<int[]> list_tmp = new LinkedList<int[]>();
		for (int i=0;i<M;i++) {
			int P = Integer.parseInt(sc.next());
			int Y = Integer.parseInt(sc.next());
			int[] tmp = {i, P, Y , 0};
			list_tmp.add(tmp);
		}
		ArrayList<int[]> list = new ArrayList<int[]>(list_tmp);
		Collections.sort(list, comparator_2);
		Collections.sort(list, comparator_1);
		int index=1;
		int former=0;
		for (int i=0;i<M;i++) {
			if (former==list.get(i)[1]) {
				index++;
				list.get(i)[3]=index;
				former=list.get(i)[1];
			} else {
				index=1;
				list.get(i)[3]=index;
				former=list.get(i)[1];
			}
		}
		Collections.sort(list, comparator_0);
		for (int i=0;i<M;i++) {
			System.out.printf("%06d%06d",list.get(i)[1],list.get(i)[3]);
			System.out.println("");
		}
	}
}

Compiler output:
Main.java:26: error: cannot find symbol
		LiskedList<int[]> list_tmp = new LinkedList<int[]>();
		^
  symbol:   class LiskedList
  location: class Main
1 error
Language: C++

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#include "prettyprint.hpp"

struct city {
  int pre;
  int year;
  int index;
  string id;
};

bool compYear(city cityA, city cityB) { return cityA.year < cityB.year; }
bool compIndex(city cityA, city cityB) { return cityA.index < cityB.index; }

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

  vector<city> PY;
  for (int i = 0; i < M; i++) {
    int P, Y;
    cin >> P >> Y;
    PY.push_back({P, Y, i, ""});
  }

  sort(PY.begin(), PY.end(), compYear);

  map<int, int> cityCount;
  for (int i = 1; i <= N; i++) {
    cityCount[i] = 1;
  }

  for (auto a = PY.begin(); a != PY.end(); a++) {
    string preStr = to_string(a->pre);
    while (preStr.length() < 6) preStr = "0" + preStr;
    string idStr = to_string(cityCount[a->pre]);
    while (idStr.length() < 6) idStr = "0" + idStr;
    cityCount[a->pre] += 1;

    a->id = preStr + idStr;
  }

  sort(PY.begin(), PY.end(), compIndex);

  for (auto a = PY.begin(); a != PY.end(); a++) {
    cout << a->id << endl;
  }
  return 0;
}

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

#include <iostream>
#include <vector>
#include <tuple>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

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

  int n, m; cin >> n >> m;
  vector<tuple<int, int, int> > tp(m);
  rep(i, m) {
    int p, y; cin >> p >> y;
    tp[i] = make_tuple(y, p, i);
  }
  sort(tp.begin(), tp.end());

  vector<pair<int, int> > vec(m);
  vector<int> cnt(n, 0);
  rep(i, m) {
    int p, y, idx;
    tie(y, p, idx) = tp[i];
    cnt[p]++;
    vec[idx] = make_pair(p, cnt[p]);
  }

  rep(i, m) {
    printf("%06d", vec[i].first);
    printf("%06d", vec[i].second);
    cout << '\n';
  }
  return 0;
}


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

#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
int N, M;
int P[100000], Y[100000];
vector <int> yd[100001];
int main()
{
	scanf_s("%d%d", &N, &M);
	for (int i = 0;i < M;i++) {
		scanf_s("%d%d",&P[i],&Y[i]);yd[P[i]].push_back(Y[i]);
	}
	for (int i = 0;i < N;i++) {
		sort(yd[i + 1].begin(), yd[i + 1].end());
	}
	for (int i = 0;i < M;i++) {
		printf("%012lld\n", ll(P[i]) * 1000000 + int(lower_bound(yd[P[i]].
			begin(), yd[P[i]].end(), Y[i]) - yd[P[i]].begin()) + 1);
	}
}

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

# include < stdio.h >
# include < vector >
# include < algorithm >
using namespace std ;
typedef long long ll ;
# define rep (i , n ) for ( int i =0; i < n ; i ++)
int N , M ;
int P [100000] , Y [100000];
vector < int > yd [100001];
int main ()
{
scanf ("% d % d " ,&N ,& M );
rep (i , M ) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
rep (i , N ) sort ( yd [ i +1]. begin () , yd [ i +1]. end ());
rep (i , M ) printf ("%012 lld \ n " , ll ( P [ i ])*1000000+ int ( lower_bound ( yd [ P [ i ]].
begin () , yd [ P [ i ]]. end () , Y [ i ]) - yd [ P [ i ]]. begin ())+1);
}

Compiler output:
a.cc:1:11: fatal error:  stdio.h : No such file or directory
    1 | # include < stdio.h >
      |           ^~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <stdlib.h>
#define MAX_N 100000

typedef struct {
  int n;
  char id[13];
  int P;
  int Y;
} st_city;

int city_sort(const void*a, const void*b) {
  int x = ((st_city*)a)->P - ((st_city*)b)->P;
  if(x != 0)
    return x;
  return (((st_city*)a)->Y - ((st_city*)b)->Y);
}

int n_sort(const void*a, const void*b) {
  return (((st_city*)a)->n - ((st_city*)b)->n);
}

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

  st_city city[MAX_N];
  for(int i = 0; i < M; i++) {
    city[i].n = i;
    scanf("%d %d", &city[i].P, &city[i].Y);
  }
  qsort(city, M, sizeof(st_city), city_sort);

  for(int i = 0; i < M; i++) {
    sprintf(city[i].id, "%06d%06d", city[i].P, i);
  }

  qsort(city, M, sizeof(st_city), n_sort);
  for(int i = 0; i < M; i++) {
    printf("%s\n", st_city[i].id);
  }

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:40:20: error: expected expression before 'st_city'
   40 |     printf("%s\n", st_city[i].id);
      |                    ^~~~~~~
Language: Java

import javafx.util.Pair;

import java.util.*;

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

		Map<Integer, List<Long>> dic = new HashMap<>();
		List<Pair<Integer, Long>> toi = new ArrayList<>();
		for (int i = 0; i< m; i++) {
			int x = sc.nextInt();
			long y = sc.nextLong();
			toi.add(new Pair<>(x, y));
			List<Long> list = dic.getOrDefault(x, new ArrayList<>());
			list.add(y);
			dic.put(x, list);
		}

		Map<Integer, Long[]> sortDic = new HashMap<>();
		dic.entrySet().stream().forEach(e -> {
			Long[] tmp = e.getValue().toArray(new Long[e.getValue().size()]);
			Arrays.sort(tmp);
			sortDic.put(e.getKey(), tmp);
		});

		for (int i = 0; i< toi.size(); i++) {
			Pair mon = toi.get(i);
			String x = mon.getKey().toString();
			String paddingleft = x.format("%6s", x).replace(" ", "0");
			String index = String.valueOf(Arrays.binarySearch(sortDic.get(mon.getKey()), mon.getValue())+1);
			String paddingRight = index.format("%6s", index).replace(" ", "0");
			System.out.println(paddingleft+paddingRight);
		}

	}
}


Compiler output:
Main.java:1: error: package javafx.util does not exist
import javafx.util.Pair;
                  ^
Main.java:12: error: cannot find symbol
		List<Pair<Integer, Long>> toi = new ArrayList<>();
		     ^
  symbol:   class Pair
  location: class Main
Main.java:16: error: cannot find symbol
			toi.add(new Pair<>(x, y));
			            ^
  symbol:   class Pair
  location: class Main
Main.java:30: error: cannot find symbol
			Pair mon = toi.get(i);
			^
  symbol:   class Pair
  location: class Main
4 errors
Language: C++

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

int main()
{
  long n, m;
  cin >> n >> m;
  vector<long> p(m), y(m), count(m), id(m);
  for (int i = 0; i < m; i++) {
    cin >> p.at(i) >> y.at(i);
    y.at(i) = 100000 * y.at(i) + i;
  }
  sort(y.begin(), y.end());
  for (int i = 0; i < m; i++) {
    long order = y.at(i) % 100000;
    count.at(p.at(order))++;
    id.at(order) = 1000000 * p.at(order) + count(p.at(order));
  }
  for (int i = 0; i < m; i++) {
    printf("%12.0ld\n", id.at(i));
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:49: error: no match for call to '(std::vector<long int>) (__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&)'
   17 |     id.at(order) = 1000000 * p.at(order) + count(p.at(order));
      |                                            ~~~~~^~~~~~~~~~~~~
Language: C++

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

int main()
{
  long n, m;
  cin >> n >> m;
  vector<long> p(m), y(m), count(m), id(m);
  for (int i = 0; i < m; i++) {
    cin >> p.at(i) >> y.at(i);
    y.at(i) = 100000 * y.at(i) + i;
  }
  sort(y.begin(), y.end());
  for (int i = 0; i < m; i++) {
    long order = y.at(i) % 100000;
    count(p.at(order))++;
    id.at(order) = 1000000 * p.at(order) + count(p.at(order));
  }
  for (int i = 0; i < m; i++) {
    printf("%12.0d\n", id.at(i));
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: no match for call to '(std::vector<long int>) (__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&)'
   16 |     count(p.at(order))++;
      |     ~~~~~^~~~~~~~~~~~~
a.cc:17:49: error: no match for call to '(std::vector<long int>) (__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&)'
   17 |     id.at(order) = 1000000 * p.at(order) + count(p.at(order));
      |                                            ~~~~~^~~~~~~~~~~~~
Language: Java

import java.util.*;

public class ID {
    public static void Main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        City[] cities = new City[m];
        for (int i = 0; i < m; i++) {
            cities[i] = new City(in.nextInt(), in.nextInt());
        }

        City[] citiesClone = cities.clone();
        Arrays.sort(citiesClone, (x, y) -> Integer.compare(x.year, y.year));
        Arrays.sort(citiesClone, (x, y) -> Integer.compare(x.prefecture, y.prefecture));

        Map<Integer, Integer> yearToNum = new HashMap<>();
        int cityNum = 1;
        int prev = 0;
        for (int i = 0; i < m; i++) {
            int currPref = citiesClone[i].prefecture;
            if (currPref == prev) {
                cityNum++;
            }
            else {
                cityNum = 1;
            }
            yearToNum.put(citiesClone[i].year, cityNum);
            prev = currPref;
        }

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < m; i++) {
            out.append(toID(Integer.toString(cities[i].prefecture)));
            out.append(toID(Integer.toString(yearToNum.get(cities[i].year))));
            out.append("\n");
        }

        System.out.println(out);
    }

    private static String toID(String s) {
        while (s.length() < 6) {
            s = "0" + s;
        }
        return s;
    }

    private static class City {
        private int prefecture;
        private int year;

        public City(int prefecture, int year) {
            this.prefecture = prefecture;
            this.year = year;
        }
    }

}


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

#include <iomanip>
#include <iostream>
#include <queue>

using namespace std;

typedef long long ll;

ll makeId(int p, int x)
{
  return (ll)p * 1000000 + x;
}

struct city {
  int no;
  int pref;
  int year;
  city(int, int, int);
};

city::city(int no, int pref, int year)
{
  this->no = no;
  this->pref = pref;
  this->year = year;
}

bool compare_cities(const city& c1, const city& c2)
{
  return c1.year < c2.year;
}


int main(void)
{
  int N, M;
  cin >> N >> M;
  vector< city > cities;
  for (int i = 0; i < M; i++) {
    int p, y;
    cin >> p >> y;
    cities.push_back(city(i, p, y));
  }

  vector< vector< city > > cities_in_pref(N + 1);
  for (int i = 0; i < M; i++) {
    cities_in_pref[cities[i].pref].push_back(cities[i]);
  }

  for (int j = 1; j <= N; j++) {
    sort(cities_in_pref[j].begin(), cities_in_pref[j].end(),compare_cities);
  }

  vector< ll > ids(M);
  for (int j = 1; j <= N; j++) {
    for(int x = 1; x <= cities_in_pref[j].size(); x++) {
      ids[cities_in_pref[j][x - 1].no] = makeId(j, x);
    }
  }

  for (int i = 0; i < M; i++) {
    cout << setfill('0') << setw(12) << right;
    cout << ids[i] << endl;
  }
}


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

#include <bits/stdc++.h>

using namespace std;

typedef pair<string,string> Data1;
typedef pair<pair<string,string>,long> Data2;

Data2 a[100001];
Data1 b[100001];
long m,n;

void Docfile()
{
    cin >> n >> m;
    for (int i=1;i<=m;i++)
    {
        cin >> b[i].first >> b[i].second;
        a[i].first.first=b[i].first;
        a[i].first.second=b[i].second;
        a[i].second=i;
    }
}

void Xuli()
{
    sort(a+1,a+1+m);
    long dem=1;
    b[a[1].second].second="1";
    for (int i=1;i<=m;i++)
    {
        if (a[i].first.first==a[i-1].first.first)
            dem++;
        else
            dem=1;
        b[a[i].second].second=to_string(dem);
    }
    for (int i=1;i<=m;i++)
    {
        for (int j=1;j<=6-b[i].first.length();j++)
            cout << '0';
        cout << b[i].first;
        for (int j=1;j<=6-b[i].second.length();j++)
            cout << '0';
        cout << b[i].second << endl;
    }
}

int main()
{
    Docfile();
    Xuli();
}


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

#include<iostream>
#include<vector>
#include<tuple>
#include<algorithm>
#include<>
using namespace std;
int N,M;

int main(){
  cin >> N >> M;
  tuple<int,int,int> data[M];
  for(int i = 0; i < M ; i++ ){
    int p,y;
    cin >> p >> y;
    data[i] = make_tuple(y,p,i);
  }

  sort(data,data+M);

  int cnt[N+1];
  fill(cnt,cnt+N+1,0);
  pair<int,int> id[M];
  for(int i = 0; i < M; i++){
    int y,p,idx;
    tie(y,p,idx) = data[i];
    cnt[p]++;
    id[idx] = make_pair(p,cnt[p]);
  }
  for(int i = 0; i < M;i++){
    cout << setw(6) << setfill('0') << id[i].first;
    cout << setw(6) << setfill('0') << id[i].second << endl;
  }
  return 0;
}


Compiler output:
a.cc:5:9: error: empty filename in #include
    5 | #include<>
      |         ^~
a.cc: In function 'int main()':
a.cc:30:13: error: 'setw' was not declared in this scope
   30 |     cout << setw(6) << setfill('0') << id[i].first;
      |             ^~~~
a.cc:5:1: note: 'std::setw' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    4 | #include<algorithm>
  +++ |+#include <iomanip>
    5 | #include<>
a.cc:30:24: error: 'setfill' was not declared in this scope
   30 |     cout << setw(6) << setfill('0') << id[i].first;
      |                        ^~~~~~~
a.cc:30:24: note: 'std::setfill' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
Language: C++

#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
typedef long long ll ;

int main(){
  int n,m;
  cin >> n >> m;
  int p[m],y[m];
  vector<int>yd[n+1];
  for(int i=0;i<m;i++){
    cin >> p[i] >> y[i];
    yd[p[i]].push_back(y[i]);
  }
  for(int i=0;i<n;i++){
    sort(yd[i].begin(),yd[i].end());
  }
  for(int i=0;i<m;i++){
  long long ans;
  ans = ll(P[i])*1000000 + lower_bound(yd[p[i]].begin(),yd[p[i]].end(),y[i])-yd[p[i]].begin()+1;
  printf("%012lld\n",ans);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: 'P' was not declared in this scope
   23 |   ans = ll(P[i])*1000000 + lower_bound(yd[p[i]].begin(),yd[p[i]].end(),y[i])-yd[p[i]].begin()+1;
      |            ^
Language: C++

n,m = map(int, input().split())
A = [[i] + input().split()+[''] for i in range(m)]
A.sort(key=lambda x:x[2])
A.sort(key=lambda x:x[1])

pref = -1
order = 1

for city in A:
    if pref == city[1]:
        order+=1
        city[2] = str(city[1]).rjust(8,'0') +str(order).rjust(8,'0')
    else:
        order = 1
        city[2] = str(city[1]).rjust(8,'0') +str(order).rjust(8,'0')
        pref = city[1]
A.sort(key=lambda x:x[0])
for city in A:
    print(city[2])

Compiler output:
a.cc:2:29: error: empty character constant
    2 | A = [[i] + input().split()+[''] for i in range(m)]
      |                             ^~
a.cc:1:1: error: 'n' does not name a type
    1 | n,m = map(int, input().split())
      | ^
Language: C++

#include <bits/stdc++.h>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using P=pair<ll,ll>;
#define INF 1000000000000000000LL
#define MOD 1000000007
#define writeln(n) cout<<n<<endl
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
//vector<tuple<long long, long long, long long>>vec;

template<class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};



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

    llong n, m;
    cin >> n >> m;
    vector<pair<P,llong>> t(m);
    REP(i,m) cin >> t[i].first.second >> t[i].first.first;
    REP(i,m) t[i].second = i;
    sort(t.begin(),t.end());
    vector<vector<llong>> cit(n);
    REP(i,m) {
        cit[t[i].first.second - 1].pb(t[i].second);
    }
    vector<string> ans(m);
    REP(i,n) REP(j,cit[i].size()) {
            string zen = to_string(i + 1);
            while(zen.size() < 6) zen = "0" + zen;
            string kou = to_string(j + 1);
            while(kou.size() < 6) kou = "0" + kou;
            ans[cit[i][j]] = zen + kou;
        }
    REP(i,m) cout << ans[i] << endl;
    return 0;
}

Compiler output:
a.cc:11:9: error: 'pair' does not name a type
   11 | using P=pair<ll,ll>;
      |         ^~~~
Language: C++

//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>


using namespace std;
int p[100000]; 
long long y[100000] ;
long long arrayy[100000];
int index[100000]; long long  cnt[100001];
int main() {

	int n, m;
	
	int P;

	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> p[i] >> y[i];
		arrayy[i] = y[i] * (int)1e5 + i;
	}
	sort(arrayy, arrayy + m);
	
	for (int i = 0; i < m; i++) {
		arrayy[i] = arrayy[i] % 100000;
	}

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




	return(0);
}

Compiler output:
a.cc:17:17: error: 'int index [100000]' redeclared as different kind of entity
   17 | int index[100000]; long long  cnt[100001];
      |                 ^
In file included from /usr/include/string.h:462,
                 from a.cc:8:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:37:22: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   37 |                 index[arrayy[i]] = cnt[P] + 1;
      |                      ^
a.cc:41:49: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   41 |                 printf("%06d%06d\n", p[i], index[i]);
      |                                                 ^
Language: C++

//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>


using namespace std;
int p[100000]; 
	long long y[100000], arrayy[100000];
	int index[100000], cnt[100001];
int main() {

	int n, m;
	
	int P;

	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> p[i] >> y[i];
		arrayy[i] = y[i] * (int)1e5 + i;
	}
	sort(arrayy, arrayy + m);
	
	for (int i = 0; i < m; i++) {
		arrayy[i] = arrayy[i] % 100000;
	}

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




	return(0);
}

Compiler output:
a.cc:16:25: error: 'int index [100000]' redeclared as different kind of entity
   16 |         int index[100000], cnt[100001];
      |                         ^
In file included from /usr/include/string.h:462,
                 from a.cc:8:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:36:22: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   36 |                 index[arrayy[i]] = cnt[P] + 1;
      |                      ^
a.cc:40:49: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   40 |                 printf("%06d%06d\n", p[i], index[i]);
      |                                                 ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
void pz(int n){
	for(int i=0;i<n;i++){
		cout<<'0';
	}
	return;
}
void pl(int n){
	int cnt=0;
	int m=n;
	while (n>0){
		cnt++;
		n=n/10;
	}
	pz(6-cnt);
	if(m!=0) cout<<m;
	return;
}
int search(vector<long long int> a,long long int n){//a[ans]<=n and ans is the biggest
	if (a[0]>n) return -1;
	int ok=0,ng=a.size(),mid;
	while(ng-ok>1){
		mid=(ok+ng)/2;
		if(a[mid]<=n){
			ok=mid;
		}else{
			ng=mid;
		}
	}
	return ok;
}


int main(){
	int n,m;
	cin>>n>>m;
	vector<int> p(m),y(m);
	long long int a;
	vector<long long int> ho(m);
	for(int i=0;i<m;i++){
		cin>>p[i];
		cin>>y[i];
		ho[i]=p[i]*1e6+y[i];
	}
	sort(ho.begin(),ho.end());
	/*for(int i=0;i<ho.size();i++){
		cout<<ho[i]<<" ";
	}
	cout<<endl;*/
	for(int i=0;i<m;i++){
		a=p[i]*1e6+y[i];
		//cout<<"#"<<a<<" "<<a-y[i]<<endl;
		//cout<<"!"<<search(ho,a)<<" "<<search(ho,a-y[i])<<endl;
		pl(p[i]);
		pl(search(ho,a)-search(ho,a-y[i]));
		cout<<endl;
	}
	return 0;
}

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