criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
//import java.lang.Math;

public class C{
	static Scanner sc = new Scanner(System.in);
	
	public static void main(String[] args){
		int n = sc.nextInt();
		int m = sc.nextInt();
		
		List<Info> list = new ArrayList<>(m);
		for(int i = 0; i < m; ++i){
			int p = sc.nextInt();
			int y = sc.nextInt();
			list.add(new Info(p, y, i));
		}
		
		Collections.sort(list, (I0, I1) -> (I0.p != I1.p) ? I0.p - I1.p : I0.y - I1.y);
		//System.out.println(list);
		
		int x = 1;
		for(int i = 0; i < m; ++i){
			if(i > 0 && list.get(i - 1).p == list.get(i).p){
				++x;
			}else{
				x = 1;
			}
			list.get(i).x = x;
		}
		
		//System.out.println(list);
		Collections.sort(list, (I0, I1) -> I0.o - I1.o);
		//System.out.println(list);
		
		for(int i = 0; i < m; ++i){
			showZero(6 - String.valueOf(list.get(i).p).length());
			System.out.print(list.get(i).p);
			showZero(6 - String.valueOf(list.get(i).x).length());
			System.out.println(list.get(i).x);
		}
	}
	
	static void showZero(int num){
		for(int i = 0; i < num; ++i){
			System.out.print(0);
		}
	}
}

class Info{
	int p;
	int y;
	int o;
	int x;
	
	public Info(int p, int y, int o){
		this.p = p;
		this.y = y;
		this.o = o;
	}
	
	/*@Override
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("[p = ");
		sb.append(p);
		sb.append(", y = ");
		sb.append(y);
		sb.append(", o = ");
		sb.append(o);
		sb.append(", x = ");
		sb.append(x);
		sb.append(']');
		return sb.toString();
	}*/
}

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

#include <iostream>
#include <array>
#include <vector>
#include <ios>
#include <iomanip>

using namespace std;

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

    struct data {
        int pref;
        int year;
        int num;
    };
    vector<data> dataList;
    for (int i = 0; i < m; i++) {
        data d;
        cin >> d.pref >> d.year;
        d.num = i;
        dataList.push_back(d);
    }
    
    sort(dataList.begin(), dataList.end(), [](const data &a, const data &b) {
        return a.year < b.year;
    });
    
    vector<data> outList;
    vector<int> pn;
    pn.resize(n);
    for (auto&& it: dataList) {
        data d;
        d.year = pn[it.pref-1];
        d.pref = it.pref;
        d.num = it.num;
        outList.push_back(d);
        pn[it.pref-1]++;
    }
    
    sort(outList.begin(), outList.end(), [](const data &a, const data &b) {
        return a.num < b.num;
    });
    
    for (auto&& it : outList) {
        cout << setfill('0') << right << setw(6) << it.pref << setfill('0') << right << setw(6) << it.year+1 << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |     sort(dataList.begin(), dataList.end(), [](const data &a, const data &b) {
      |     ^~~~
      |     short
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
struct P{
	int p,y,d;
	int b[15];
};
int cmp(P x1,P x2){
	if(x1.p==x2.p){
		return x1.y<x2.y;
	}
	return x1.p<x2.p;
}
int cmp1(P x1,P x2){
	return x1.d<x2.d;
}
P a[100010];
int main(){
	int n,m,i,j,k;
	cin >> n >> m;
	for(i=0;i<m;i++){
		cin >> a[i].p >> a[i].y;
		a[i].d=i;
		for(j=0;j<13;j++){
			a[i].b[j]=0;
		}
	}
	sort(a,a+m,cmp);
	int x=1;
	for(i=0;i<m;i++){
		if(i==0 || a[i].p!=a[i-1].p){
			x=1;
		}
		else{
			x++;
		}
		j=5;
		p=a[i].p;
		while(p){
			a[i].b[j]=p%10;
			p/=10;
			if(j==0)
				break;
			j--;
		}
		p=x;
		j=11;
		while(p){
			a[i].b[j]=p%10;
			p/=10;
			if(j==6)
				break;
			j--;
		}
	}
	sort(a,a+m,cmp1);
	for(i=0;i<m;i++){
		for(j=0;j<12;j++){
			cout << a[i].b[j];
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: 'p' was not declared in this scope
   38 |                 p=a[i].p;
      |                 ^
Language: C++

#include <cstdio>
#include<cmath>
#include <algorithm>
#include <cstring>
#include<iostream>
using namespace std;
int num[100005][2];
int nn[100005];
int w[100005][100005];
int main()
{
    memset(nn,0,sizeof(nn));
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        scanf_s("%d %d",&num[i][0],&num[i][1]);
        
        w[num[i][0]][nn[num[i][0]]]=num[i][1];
        nn[num[i][0]]++;
    }
    for(int i=1;i<=m;i++){
        if(nn[num[i][0]]==0)
            continue;
        sort(w[num[i][0]],w[num[i][0]]+nn[num[i][0]]);
    }
    for(int i=1;i<=m;i++){
        cout.fill('0');
        cout.width(6);
        cout<<num[i][0];
        for(int j=0;;j++){
            if(w[num[i][0]][j]==num[i][1]){
                cout.fill('0');
                cout.width(6);
                cout<<j+1<<endl;
                break;
            }
        }
        
        
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   16 |         scanf_s("%d %d",&num[i][0],&num[i][1]);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(ll i=0;i<n;i++)
#define ALL(a)  (a).begin(),(a).end()
ll n,m;
ll p[100000],y[100000];
vector<ll> yd[100001];
int main(){
  cin>>n>>m;
  rep(i,m){
    cin>>p[i]>>y[i];
    yd[p[i]].push_back(y[i]);
  }
  rep(i,n){
    sort(ALL(yd[i+1]));
  }
  rep(i,m){
    printf("%012lld\n",ll(p[i])*1000000+(lower_bound(ALL(yd[p[i]]),y[i])-yd[p[i]].begin())+1;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:93: error: expected ')' before ';' token
   19 |     printf("%012lld\n",ll(p[i])*1000000+(lower_bound(ALL(yd[p[i]]),y[i])-yd[p[i]].begin())+1;
      |           ~                                                                                 ^
      |                                                                                             )
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a)  (a).begin(),(a).end()
int n,m;
int p[100000],y[100000]; vector<ll> yd[100001];
int main(){
  cin>>n>>m;
  rep(i,m){
    cin>>p[i]>>y[i];
    yd[p[i]].push_back(y[i]);
  }
  rep(i,n){
    sort(ALL(yd[i+1]));
  }
  rep(i,m){
    cout<<ll(p[i])*1000000+int(lower_bound(ALL(yd[p[i]]),y[i])-yd[p[i]].begin())+1)<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:83: error: expected ';' before ')' token
   18 |     cout<<ll(p[i])*1000000+int(lower_bound(ALL(yd[p[i]]),y[i])-yd[p[i]].begin())+1)<<endl;
      |                                                                                   ^
      |                                                                                   ;
Language: C++

#include <cstdio> 
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a)  (a).begin(),(a).end()
int n,m;
int p[100000],y[100000]; vector<ll> yd[100001];
int main(){
  cin>>n>>m;
  rep(i,m){
    cin>>p[i]>>y[i];
    yd[p[i]].push_back(y[i]);
  }
  rep(i,n){
    sort(ALL(yd[i+1]));
  }
  rep(i,m){
    printf("%012lld\n",ll(p[i])*1000000+int(lower_bound(ALL(yd[p[i]]),y[i])-yd[p[i]].begin())+1);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin>>n>>m;
      |   ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <algorithm>
  +++ |+#include <iostream>
    4 | using namespace std;
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++)
#define ALL(a)  (a).begin(),(a).end()
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(ALL(yd[i+1]));
  }
  rep(i,m){
    printf("%012lld\n",ll(p[i])*1000000+int(lower_bound(ALL(yd[p[i]]),y[i])-yd[p[i]].begin())+1);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'M' was not declared in this scope
   13 |   rep(i,M){
      |         ^
a.cc:6:32: note: in definition of macro 'rep'
    6 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
Language: C++

#include <cstdio> 
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a)  (a).begin(),(a).end()
int n,m;
int p[100000],y[100000]; vector<ll> 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(ALL(yd[i+1]));
  }
  rep(i,m){
    printf("%012lld\n",ll(p[i])*1000000+int(lower_bound(ALL(yd[p[i]]),y[i])-yd[P[i]].begin())+1);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:80: error: 'P' was not declared in this scope
   20 |     printf("%012lld\n",ll(p[i])*1000000+int(lower_bound(ALL(yd[p[i]]),y[i])-yd[P[i]].begin())+1);
      |                                                                                ^
Language: C++

#include <cstdio> 
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a)  (a).begin(),(a).end()
int n,m;
int p[100000],y[100000]; vector<ll> 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(ALL(yd[i+1]));
  }
  rep(i,m){
    printf("%012lld\n",ll(p[i])*1000000+int(lower_bound(ALL(yd[p[i]]),y[i])-yd[P[i]].begin())+1);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:80: error: 'P' was not declared in this scope
   20 |     printf("%012lld\n",ll(p[i])*1000000+int(lower_bound(ALL(yd[p[i]]),y[i])-yd[P[i]].begin())+1);
      |                                                                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  int p[m];
  long y[m];
  int i;
  int city[n+1] = {};
  long tmp = 0;
  string s;
  vector<pair<int,int>> pairs(m);
  for(i=0;i<m;i++){
    cin >> p[i] >> y[i];
    pairs[i]= make_pair(y[i],i);
  }

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

  for(i=0;i<m;i++){
    s="";
    tmp = 0;
    city[p[pairs[i].second]]++;
    tmp+=city[p[pairs[i].second]];
    tmp += 1000000*p[pairs[i].second];
    sprintf("%012d",tmp);
  }
  


}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   26 |     sprintf("%012d",tmp);
      |             ^~~~~~~
a.cc:26:21: error: invalid conversion from 'long int' to 'const char*' [-fpermissive]
   26 |     sprintf("%012d",tmp);
      |                     ^~~
      |                     |
      |                     long int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:366:44: note:   initializing argument 2 of 'int sprintf(char*, const char*, ...)'
  366 |                     const char *__restrict __format, ...) __THROWNL;
      |                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
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++)
#define ALL(a)  (a).begin(),(a).end()
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(ALL(yd[i+1]));
  }
  rep(i,M){
    printf("%012lld\n",ll(P[i])*1000000+int(lower_bound(ALL(yd[P[i]]),Y[i])-yd[P[i]].begin())+1);
}

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


#include<bits/stdc++.h>
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:5:14: error: 'i' was not declared in this scope
    5 | #define rep (i , n ) for ( int i =0; i < n ; i ++)
      |              ^
a.cc:12:1: note: in expansion of macro 'rep'
   12 | rep (i , M ) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
      | ^~~
a.cc:5:18: error: 'n' was not declared in this scope
    5 | #define rep (i , n ) for ( int i =0; i < n ; i ++)
      |                  ^
a.cc:12:1: note: in expansion of macro 'rep'
   12 | rep (i , M ) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
      | ^~~
Language: C++

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

int main(){
  int N,M; cin>>N>>M;
  int p[M],y[M];
  vector<map<int,int>> num(N+1);
  for(int i=0;i<M;i++){
    cin>>p[i]>>y[i];
    num[p[i]][y[i]]=0;  
  }
  for(int i=0;i<M;i++){
   printf("%012lld\n",long long(p[i]*1000000+1+int(-num[p[i]].begin()+num[p[i]].find(y[i])));
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: expected primary-expression before 'long'
   13 |    printf("%012lld\n",long long(p[i]*1000000+1+int(-num[p[i]].begin()+num[p[i]].find(y[i])));
      |                       ^~~~
Language: C++

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

using namespace std ;

typedef long long ll ;
int N , M ;
int P [100010] , Y [100010];
vector <int> yd [100010];
int main (){
	cin >> N >> M;
	for (int i=0;i<M;i++){
      scanf("%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++){
      long long int a = lower_bound(yd[P[i]].begin(),yd[P[i]].end(),Y[i])-yd[P[i]].begin()+1;
      printf ("%012lld\n",ll(P[i])*1000000+a);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: expected ';' before 'yd'
   14 |       scanf("%d%d", &P[i],&Y[i])
      |                                 ^
      |                                 ;
   15 |       yd[P[i]].push_back(Y[i]);
      |       ~~
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
 
public class Main implements Comparable<Main>{
  private int index;
  private int prefecture;
  private int year;
  private int rank;
 
  Main(int index,int prefecture,int year,int rank){
    this.index = index;
    this.prefecture = prefecture;
    this.year = year;
    this.rank = rank;
  }
 
  public int get_index(){
    return this.index;
  }
  public int get_pre(){
    return this.prefecture;
  }
  public int get_year(){
    return this.year;
  }
 
  public void set_rank(int rank){
    this.rank = rank;
  }
 
  public int get_rank(){
    return this.rank;
  }
 
  public int compareTo(Main id){
    if(this.prefecture<id.prefecture){
      return -1;
    }else if(this.prefecture>id.prefecture){
      return 1;
    }else{
      if(this.year<id.year){
        return -1;
      }else if(this.year>id.year){
        return 1;
      }else{
        return 0;
      }
    }
  }
  @Override
  public String toString() {
    return "Prefecture=" + this.get_pre() + ", Year=" + this.get_year();
  }
 
 
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
 
    Main[] IDs = new Main[m];
 
    for(int i=0; i<m; i++){
      IDs[i] = new Main(i+1,sc.nextInt(),sc.nextInt(),0);
    }
    Arrays.sort(IDs);
    IDs[0].set_rank(1);
    for(int i=1; i<m; i++){
      if(IDs[i-1].get_pre()==IDs[i].get_pre()){
        IDs[i].set_rank(IDs[i-1].get_rank()+1);
      }else{
        IDs[i].set_rank(1);
      }
    }
 
    //for(int i=0; i<m; i++){
      //System.out.println(IDs[i].get_rank());
    //}
 
    Arrays.sort(IDs, new Comparator<ID>() {
	    public int compare(Main id1, Main id2) {
		    return id1.get_index() - id2.get_index();
	    }
    });
    for(int i=0; i<m; i++){
      String str = String.format("%06d%06d",IDs[i].get_pre(),IDs[i].get_rank());
      System.out.println(str);
    }
 
 
 
 
 
 
 
 
 
  }
 
 
}

Compiler output:
Main.java:82: error: cannot find symbol
    Arrays.sort(IDs, new Comparator<ID>() {
                                    ^
  symbol:   class ID
  location: class Main
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class Main implements Comparable<Main>{
  private int index;
  private int prefecture;
  private int year;
  private int rank;

  ID(int index,int prefecture,int year,int rank){
    this.index = index;
    this.prefecture = prefecture;
    this.year = year;
    this.rank = rank;
  }

  public int get_index(){
    return this.index;
  }
  public int get_pre(){
    return this.prefecture;
  }
  public int get_year(){
    return this.year;
  }

  public void set_rank(int rank){
    this.rank = rank;
  }

  public int get_rank(){
    return this.rank;
  }

  public int compareTo(Main id){
    if(this.prefecture<id.prefecture){
      return -1;
    }else if(this.prefecture>id.prefecture){
      return 1;
    }else{
      if(this.year<id.year){
        return -1;
      }else if(this.year>id.year){
        return 1;
      }else{
        return 0;
      }
    }
  }
  @Override
  public String toString() {
    return "Prefecture=" + this.get_pre() + ", Year=" + this.get_year();
  }


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

    Main[] IDs = new Main[m];

    for(int i=0; i<m; i++){
      IDs[i] = new Main(i+1,sc.nextInt(),sc.nextInt(),0);
    }
    Arrays.sort(IDs);
    IDs[0].set_rank(1);
    for(int i=1; i<m; i++){
      if(IDs[i-1].get_pre()==IDs[i].get_pre()){
        IDs[i].set_rank(IDs[i-1].get_rank()+1);
      }else{
        IDs[i].set_rank(1);
      }
    }

    //for(int i=0; i<m; i++){
      //System.out.println(IDs[i].get_rank());
    //}

    Arrays.sort(IDs, new Comparator<ID>() {
	    public int compare(Main id1, Main id2) {
		    return id1.get_index() - id2.get_index();
	    }
    });
    for(int i=0; i<m; i++){
      String str = String.format("%06d%06d",IDs[i].get_pre(),IDs[i].get_rank());
      System.out.println(str);
    }









  }


}

Compiler output:
Main.java:12: error: invalid method declaration; return type required
  ID(int index,int prefecture,int year,int rank){
  ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class Main implements Comparable<Main>{
  private int index;
  private int prefecture;
  private int year;
  private int rank;

  Main(int index,int prefecture,int year,int rank){
    this.index = index;
    this.prefecture = prefecture;
    this.year = year;
    this.rank = rank;
  }

  public int get_index(){
    return this.index;
  }
  public int get_pre(){
    return this.prefecture;
  }
  public int get_year(){
    return this.year;
  }

  public void set_rank(int rank){
    this.rank = rank;
  }

  public int get_rank(){
    return this.rank;
  }

  public int compareTo(Main id){
    if(this.prefecture<id.prefecture){
      return -1;
    }else if(this.prefecture>id.prefecture){
      return 1;
    }else{
      if(this.year<id.year){
        return -1;
      }else if(this.year>id.year){
        return 1;
      }else{
        return 0;
      }
    }
  }
  @Override
  public String toString() {
    return "Prefecture=" + this.get_pre() + ", Year=" + this.get_year();
  }


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

    Main[] IDs = new Main[m];

    for(int i=0; i<m; i++){
      IDs[i] = new Main(i+1,sc.nextInt(),sc.nextInt(),0);
    }
    Arrays.sort(IDs);
    IDs[0].set_rank(1);
    for(int i=1; i<m; i++){
      if(IDs[i-1].get_pre()==IDs[i].get_pre()){
        IDs[i].set_rank(IDs[i-1].get_rank()+1);
      }else{
        IDs[i].set_rank(1);
      }
    }

    //for(int i=0; i<m; i++){
      //System.out.println(IDs[i].get_rank());
    //}

    Arrays.sort(IDs, new Comparator<Main>() {
	    public int compare(Main id1, Main id2) {
		    return id1.get_index() - id2.get_index();
	    }
    });
    for(int i=0; i<m; i++){
      String str = String.format("%06d%06d",IDs[i].get_pre(),IDs[i].get_rank());
      System.out.println(str);
    }

Compiler output:
Main.java:90: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(a) (a).begin(),(a).end()
#define SORT(a) sort(all(a))
#define rSORT(a, i) sort(all(a),(i))

using ll = long long;
constexpr ll INF = 10000000000;
constexpr ll MOD = 1000000007;

using namespace std;

int n, m;
vector<pair<int, int>> E[101010];
string ans[101010];

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

	rep(i, m) {
		int p, y; cin >> p >> y;
		E[p].push_back({ y,i });
	}
	for (int i = 1; i < n + 1; i++) {
		sort(all(E[i]));
		int n = E[i].size();
		for (int j = 0; j < n; j++) {
			char buf[13];
			sprintf_s(buf, "%06d%06d", i, j + 1);
			ans[E[i][j].second] = string(buf);
		}
	}
	//rep(i,m)printf("%s\n", ans[i].c_str());
	//↑も↓もおんなじっぽい
	rep(i, m)cout << ans[i] << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   30 |                         sprintf_s(buf, "%06d%06d", i, j + 1);
      |                         ^~~~~~~~~
      |                         sprintf
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(a) (a).begin(),(a).end()
#define SORT(a) sort(all(a))
#define rSORT(a, i) sort(all(a),(i))

using ll = long long;
constexpr ll INF = 10000000000;
constexpr ll MOD = 1000000007;

using namespace std;

int n, m;
vector<pair<int, int>> E[101010];
string ans[101010];

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

	rep(i, m) {
		int p, y; cin >> p >> y;
		E[p].push_back({ y,i });
	}
	for (int i = 1; i < n + 1; i++) {
		int n = E[i].size();
		for (int j = 0; j < n; j++) {
			char buf[13];
			sprintf_s(buf, "%06d%06d", i, j + 1);
			ans[E[i][j].second] = string(buf);
		}
	}
	//rep(i,m)printf("%s\n", ans[i].c_str());
	//↑も↓もおんなじっぽい
	rep(i, m)cout << ans[i] << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:25: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   29 |                         sprintf_s(buf, "%06d%06d", i, j + 1);
      |                         ^~~~~~~~~
      |                         sprintf
Language: C++

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

const int m_max = 100000;
int n, m;
int p[m_max], y[m_max];
vector<int> ans[m_max+1];

int main(){
  cin>>n >>m;
  
  for(int i=0;i<m;i++){
    cin>>p[i] >>y[i];
    ans[p[i]].push_back(y[i]);
  }
  
  for(int i=0;i<n;i++){
    sort(ans[i+1].begin(), ans[i+1].end());
  }
  
  for(int i=0;i<m;i++){
    cout<<long long(p[i])*1000000 + int(lower_bound(ans[p[i]].begin(), ans[p[i]].end(), y[i])-ans[p[i]].begin()+1)<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: expected primary-expression before 'long'
   22 |     cout<<long long(p[i])*1000000 + int(lower_bound(ans[p[i]].begin(), ans[p[i]].end(), y[i])-ans[p[i]].begin()+1)<<endl;
      |           ^~~~
Language: C++

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

const int m_max = 100000;
int n, m;
int p[m_max], y[m_max];
vector<int> ans[m_max+1];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: expected primary-expression before 'long'
   22 |     printf("%01211d\n", long long(p[i])*1000000 + int(lower_bound(ans[p[i]].begin(), ans[p[i]].end(), y[i])-ans[p[i]].begin()+1);
      |                         ^~~~
Language: C++

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

const int m_max = 100000;
int n, m;
int p[m_max], y[m_max];
vector<int> ans[m_max+1];

int main(){
  cin>>n >>m;
  
  for(int i=0;i<m;i++){
    cin>>p[i] >>y[i];
    ans[p[i]].push_back(y[i]);
  }
  
  for(int i=0;i<n;i++){
    sort(ans[i+1].begin(), ans[i+1].end());
  }
  
  for(int i=0;i<m;i++){
    cout<<long long(p[i])*1000000 + int(lower_bound(ans[p[i]].begin(), ans[p[i]].end(), y[i])-ans[p[i]].begin()+1);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: expected primary-expression before 'long'
   22 |     cout<<long long(p[i])*1000000 + int(lower_bound(ans[p[i]].begin(), ans[p[i]].end(), y[i])-ans[p[i]].begin()+1);
      |           ^~~~
Language: C++

#include<stdio.h>
#include <assert.h>
#include<math.h>

int main(void){
    int n;
    int m;
    int p[100000];
    int y[100000];

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

 

    printf("%d\n", minElement(b, n)+1);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: 'b' was not declared in this scope
   20 |     printf("%d\n", minElement(b, n)+1);
      |                               ^
a.cc:20:20: error: 'minElement' was not declared in this scope
   20 |     printf("%d\n", minElement(b, n)+1);
      |                    ^~~~~~~~~~
Language: C++

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

int main() {
    int n,m;
    cin>>n>>m;
    vector<int> a[n+1];
    int p[m],y[m];
    for (int i=0;i<m;i++) {
        cin>>p[i]>>y[i];
        a[p[i]].push_back(y[i]);
    }
    for (int i=1;i<=n;i++)
        sort(a[i].begin(),a[i].end());
    for (int i=0;i<m;i++) {
        printf("%06d%06d\n",p[i],lower_bound(a[p[i]].begin(),a[p[i]].end(),y[i])-a[p[i]].begin()-1);
    return 0;
}

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

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

using namespace std;

bool cmp1(pair<int, pair<int, long long int> > a, pair<int, pair<int ,long long int> > b) {
    if(a.second.first!=b.second.first) {
        return a.second.first<b.second.first;
    } else {
        return a.second.second<b.second.second;
    }
}
bool cmp2(pair<int, pair<int, long long int> > a, pair<int, pair<int ,long long int> > b) {
    return a.first<b.first;
}

int main() {
    int N, M;
    cin >> N >> M;
    
    vector<pair<int, pair<int, long long int> > > recpy, ans;
    
    for(int i=0; i<M; i++) {
        int p;
        long long int y;
        cin >> p >> y;
        
        recpy.push_back(make_pair(i, make_pair(p, y)));
    }
    
    sort(recpy.begin(), recpy.end(), cmp1);
    
    int pp=recpy[0].second.first;
    int count=1;
    for(int i=0; i<M; i++) {
        if(pp==recpy[i].second.first) {
            ans.push_back(make_pair(recpy[i].first, make_pair(pp, count)));
            count++;
        } else {
            count=1;
            pp=recpy[i].second.first;
            ans.push_back(make_pair(recpy[i].first, make_pair(pp, count)));
        }
    }
    
    sort(ans.begin(), ans.end(), cmp2);
    
    for(int i=0; i<M; i++) {
        printf("%06d%06lld\n", ans[i].second.first, ans[i].second.second);
    }

    return 0;
    
}

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

#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <cstdio>

using namespace std;

bool cmp(pair<int, pair<int, long long int> > a, pair<int, pair<int , long long int> > b) {
    if(a.second.first!=b.second.first) {
        return a.second.first < b.second.first;
    } else {
        return a.second.second < b.second.second;
    }
}

int main() {
    int N, M;
    cin >> N >> M;
    
    vector<pair<int, pair<int, long long int> > > ipy(M, \
        pair<int, pair<int, long long int> >());
    for(int i=0; i<M; i++) {
        int p;
        long long int y;
        cin >> p >> y;
        ipy[i] = make_pair(i, make_pair(p, y));
    }
    
    sort(ipy.begin(), ipy.end(), cmp);

    // for(int i=0; i<M; i++) {
    //     cout << "After Sorted: " << ipy[i].first << ", " \
    //     << ipy[i].second.first << ", " << ipy[i].second.second << endl;
    // }

    vector<pair<int, int> > ans(M, \
        pair<int, int>());
    int count=1;
    int group=1;
    for(int i=0; i<M; i++) {
        if(group!=ipy[i].second.first) {
            group++;
            count=1;
        }
        // cout << i << ", " << ipy[i].first << ", " << ipy[i].second.first \
        // << ", " << count << endl;
        ans[ipy[i].first] = make_pair(ipy[i].second.first, count);
        count++;
    }
    for(int i=0; i<M; i++) {
        char str[13];
        sprintf(str, "%06d%06d", ans[i].first, ans[i].second);
        cout << str << endl;
    }
    
    return 0;
    
}

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

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

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

    std::vector<std::pair<int, long long>> PY(M);
    std::vector<std::vector<long long>> C(N);

    for (int i = 0; i < M; i++) {
        std::cin >> PY[i].first >> PY[i].second;
        C[PY[i].first].push_back(PY[i].second);
    }

    for (int i = 0; i < N; i++) {
        std::sort(std::begin(C[i]), std::end(C[i]));
    }

    for (int i = 0; i < M; i++) {
        auto & v = C[PY[i].first]; // PY[i].firstが県番号

        for (int j = 0; j < v.size(); j++) { // j+1が市番号
            if (PY[i].second == v[j].first) {
                printf("%06d%06d\n", PY[i].first, j+1);
                break;                
            }
        }
    }  

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:38: error: request for member 'first' in '(& v)->std::vector<long long int>::operator[](((std::vector<long long int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   27 |             if (PY[i].second == v[j].first) {
      |                                      ^~~~~
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: In function 'int main()':
a.cc:6:15: error: 'i' was not declared in this scope
    6 | # define rep (i , n) for (int i =0; i < n ; i ++)
      |               ^
a.cc:13:1: note: in expansion of macro 'rep'
   13 | rep (i , M) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
      | ^~~
a.cc:6:19: error: 'n' was not declared in this scope
    6 | # define rep (i , n) for (int i =0; i < n ; i ++)
      |                   ^
a.cc:13:1: note: in expansion of macro 'rep'
   13 | rep (i , M) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
      | ^~~
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: In function 'int main()':
a.cc:6:15: error: 'i' was not declared in this scope
    6 | # define rep (i , n ) for ( int i =0; i < n ; i ++)
      |               ^
a.cc:13:1: note: in expansion of macro 'rep'
   13 | rep (i , M ) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
      | ^~~
a.cc:6:19: error: 'n' was not declared in this scope
    6 | # define rep (i , n ) for ( int i =0; i < n ; i ++)
      |                   ^
a.cc:13:1: note: in expansion of macro 'rep'
   13 | rep (i , M ) scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) , yd [ P [ i ]]. push_back ( Y [ i ]);
      | ^~~
Language: C++

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

typedef struct{
  int prefecture;
  int year;
} City;

int main()
{
  int N;
  int M;
  cin >> N >> M;
  City C[110000];
  
  list<int> Y[110000];
  list<int>::iterator itr;
  
  for(int i=0;i<M;i++){
    int p;
    int y;
    cin >> p >> y; 
    C[i].prefecture = p;
    C[i].year = y;
    Y[p].push_back(y);
  }

  for(int i=1;i<=N;i++){
    Y[i].sort(Y[i].begin(), Y[i].end());
  }
    

  for(int i=0;i<M;i++){
    int p, y;
    p = C[i].prefecture;
    y = C[i].year;
    //search year
    int idx=0;
    for(itr=Y[p].begin(); itr!=Y[p].end(); itr++){
        idx++;
        if(y==*itr) break;
    }
    printf("%06d%06d\n", p, idx);
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: no matching function for call to 'std::__cxx11::list<int>::sort(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator)'
   30 |     Y[i].sort(Y[i].begin(), Y[i].end());
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/list:65,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_list.h:1920:9: note: candidate: 'template<class _StrictWeakOrdering> void std::__cxx11::list<_Tp, _Alloc>::sort(_StrictWeakOrdering) [with _Tp = int; _Alloc = std::allocator<int>]'
 1920 |         sort(_StrictWeakOrdering);
      |         ^~~~
/usr/include/c++/14/bits/stl_list.h:1920:9: note:   candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/list:66:
/usr/include/c++/14/bits/list.tcc:481:5: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::sort() [with _Tp = int; _Alloc = std::allocator<int>]'
  481 |     list<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/list.tcc:481:5: note:   candidate expects 0 arguments, 2 provided
Language: C++

#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

int N,M;
vector<int> p[100000];
vector<pair<int, int> > vp;

int main(){
    int x,y;
    cin >> N >> M;
    for(int i=0;i<M;i++){
        cin >> x >> y;
        vp.push_back(make_pair(x-1,y));
        p[x-1].push_back(y);
    }
    for(int i=0;i<N;i++) sort(p[i].begin(),p[i].end());
    for(int i=0;i<M;i++){
        cout << setfill('0') << right << setw(6) << (vp[i].first + 1);
        int q = lower_bound(p[vp[i].first].begin(),p[vp[i].first].end(),vp[i].second) - p[vp[i].first].begin();
        cout << setfill('0') << right << setw(6) << q+1 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope
   13 |     cin >> N >> M;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <utility>
  +++ |+#include <iostream>
    4 | 
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << setfill('0') << right << setw(6) << (vp[i].first + 1);
      |         ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:17: error: 'setfill' was not declared in this scope
   21 |         cout << setfill('0') << right << setw(6) << (vp[i].first + 1);
      |                 ^~~~~~~
a.cc:4:1: note: 'std::setfill' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <utility>
  +++ |+#include <iomanip>
    4 | 
a.cc:21:33: error: 'right' was not declared in this scope
   21 |         cout << setfill('0') << right << setw(6) << (vp[i].first + 1);
      |                                 ^~~~~
a.cc:4:1: note: 'std::right' is defined in header '<ios>'; this is probably fixable by adding '#include <ios>'
    3 | #include <utility>
  +++ |+#include <ios>
    4 | 
a.cc:21:42: error: 'setw' was not declared in this scope
   21 |         cout << setfill('0') << right << setw(6) << (vp[i].first + 1);
      |                                          ^~~~
a.cc:21:42: note: 'std::setw' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
a.cc:23:60: error: 'endl' was not declared in this scope
   23 |         cout << setfill('0') << right << setw(6) << q+1 << endl;
      |                                                            ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <utility>
  +++ |+#include <ostream>
    4 |
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
long long MOD = 1e9 + 7;
using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> p(m), y(m);
  vector<vector<int>> y_sort(N + 1);

  rep(i, M) {
    cin >> p[i] >> y[i];
    y_sort[p[i]].push_back(y[i]);
  }

  rep(i, n) { sort(y_sort[p[i + 1]].begin(), y_sort[p[i + 1]].end()); }

  for (int i = 0; i < m; i++) {
    printf("%012lld\n", ll(p[i]) * 1000000 + int(lower_bound(all(y_sort[p[i]]), y[i]) - y_sort[p[i]].begin()) +1);
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: 'N' was not declared in this scope
   12 |   vector<vector<int>> y_sort(N + 1);
      |                              ^
a.cc:14:10: error: 'M' was not declared in this scope
   14 |   rep(i, M) {
      |          ^
a.cc:2:45: note: in definition of macro 'rep'
    2 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                             ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
long long MOD = 1e9 + 7;
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> P(M);
  vector<int> Y(M);
  vector<vector<int>> y_sort(N + 1);

  rep(i, M) {
    cin >> P[i] >> Y[i];
    y_sort[P[i]].push_back(Y[i]);
  }

  rep(i, N) { sort(y_sort[P[i + 1]].begin(), y_sort[P[i + 1]].end()); }

  for (int i = 0; i < M; i++) {
    printf("%012lld\n", ll(P[i]) * 1000000 +
                            int(lower_bound(all(y_sort[P[i]]), Y[i]) -
                                y_sort[P[i]].begin()) +
                            1);
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:45: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   23 |                             int(lower_bound(all(y_sort[P[i]]), Y[i]) -
      |                                             ^~~
      |                                             std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
long long MOD = 1e9 + 7;
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> P(M);
  vector<int> Y(M);
  vector<vector<int>> y_sort(N + 1);

  rep(i, M) {
    cin >> P[i] >> Y[i];
    y_sort[P[i]].push_back(Y[i]);
  }

  rep(i, N) { sort(y_sort[P[i + 1]].begin(), y_sort[P[i + 1]].end()); }

  for (int i = 0; i < M; i++) {
    printf("%012lld\n", ll(p[i]) * 1000000 +
                            int(lower_bound(all(y_sort[P[i]]), Y[i]) -
                                y_sort[P[i]].begin()) +
                            1);
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: 'p' was not declared in this scope
   22 |     printf("%012lld\n", ll(p[i]) * 1000000 +
      |                            ^
a.cc:23:45: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   23 |                             int(lower_bound(all(y_sort[P[i]]), Y[i]) -
      |                                             ^~~
      |                                             std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
long long MOD = 1e9 + 7;
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> P(M);
  vector<int> Y(M);
  vector<vector<int>> y_sort(N + 1);

  rep(i, M) {
    cin >> P[i] >> Y[i];
    y_sort[P[i]].push_back(Y[i]);
  }

  rep(i, N) { sort(y_sort[P[i + 1]].begin(), y_sort[P[i + 1]].end()); }

  for (int i = 0; i < M; i++) {
    int iter = int(lower_bound(y_sort[P[i]].begin(), y_sort[P[i]].end(), Y[i]) -
                   y_sort[P[i]].begin());
    cout.fill('0')' cout << setw(6) << P[i] << setw(6) << order + 1 << endl;
  }

  return 0;
}

Compiler output:
a.cc:24:19: warning: missing terminating ' character
   24 |     cout.fill('0')' cout << setw(6) << P[i] << setw(6) << order + 1 << endl;
      |                   ^
a.cc:24:19: error: missing terminating ' character
   24 |     cout.fill('0')' cout << setw(6) << P[i] << setw(6) << order + 1 << endl;
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:24:19: error: expected ';' before '}' token
   24 |     cout.fill('0')' cout << setw(6) << P[i] << setw(6) << order + 1 << endl;
      |                   ^
      |                   ;
   25 |   }
      |   ~
Language: C

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
long long MOD = 1e9 + 7;
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> P(100001);
  vector<int> Y(100001);
  vector<vector<int>> y_sort(100001);

  rep(i, M) {
    cin >> P[i] >> Y[i];
    y_sort[P[i]].push_back(Y[i]);
  }

  rep(i, N) { sort(y_sort[P[i + 1]].begin(), y_sort[P[i + 1]].end()); }

  for (int i = 0; i < M; i++) {
    auto iter = lower_bound(y_sort[P[i]].begin(), y_sort[P[i]].end(), Y[i]);
    int order = iter - y_sort[P[i]].begin();
    cout.fill('0');
    cout << setw(6) << P[i] << setw(6) << order + 1 << endl;
  }

  return 0;
}

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 <bits/stdc++.h>
#define rep(i,a) for(int i=0;i<int(a);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
using ll = long long;
using itn = int;
using namespace std;
using Graph = vector<vector<int>>;
int GCD(int a, int b){
    return b ? GCD(b, a%b) : a;
}
int main(){
    int N,M;
    cin>>N>>M;
    vector<int> P(M),Y(M);
    vector<vector<int>> city(N);
    int rank[N][10e9+10]={};
    rep(i,M){
        int p,y;
        cin>>p>>y;
        P.at(i)=p;
        Y.at(i)=y;
        p--;
        city.at(p).push_back(y);
    }
    for(int i=0; i<N; i++){
        sort(city.at(i).begin(),city.at(i).end());
    }
    rep(i,N){
        int r=1;
        for(int j:city.at(i)){
            rank[i][j]=r;
            r++;
        }
    }
    rep(i,M){
        printf("%06d%06d\n",P.at(i),rank[P.at(i)-1][Y.at(i)]);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   20 |     int rank[N][10e9+10]={};
      |                 ~~~~^~~
a.cc:20:21: error: could not convert '(1.0e+10 + (double)10)' from 'double' to 'long unsigned int'
   20 |     int rank[N][10e9+10]={};
      |                 ~~~~^~~
      |                     |
      |                     double
a.cc:20:21: error: size of array 'rank' has non-integral type 'double'
Language: C++

#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7;

int main() {
  ll n, m;
  cin >> n >> m;
  vector<pair<pair<ll, ll>, ll>> in;
  vector<LL> p(m), y(m);
  vector<ll> cnt(n + 1, 0), ans(m);

  for (int i = 0; i < m; i++) {
    cin >> p[i] >> y[i];
    in.push_back(make_pair(make_pair(y[i], p[i]), i));
  }
  sort(in.begin(), in.end());

  for (int i = 0; i < in.size(); i++) {
    cnt[in[i].first.second]++;
    ans[in[i].second] = cnt[in[i].first.second];
  }

  for (ll i = 0; i < m; i++) {
    out << std::setfill('0') << std::right << std::setw(6) << P[i];
    out << std::setfill('0') << std::right << std::setw(6) << num[i];
    out << std::endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'LL' was not declared in this scope; did you mean 'll'?
   11 |   vector<LL> p(m), y(m);
      |          ^~
      |          ll
a.cc:11:12: error: template argument 1 is invalid
   11 |   vector<LL> p(m), y(m);
      |            ^
a.cc:11:12: error: template argument 2 is invalid
a.cc:15:13: error: invalid types 'int[int]' for array subscript
   15 |     cin >> p[i] >> y[i];
      |             ^
a.cc:15:21: error: invalid types 'int[int]' for array subscript
   15 |     cin >> p[i] >> y[i];
      |                     ^
a.cc:16:39: error: invalid types 'int[int]' for array subscript
   16 |     in.push_back(make_pair(make_pair(y[i], p[i]), i));
      |                                       ^
a.cc:16:45: error: invalid types 'int[int]' for array subscript
   16 |     in.push_back(make_pair(make_pair(y[i], p[i]), i));
      |                                             ^
a.cc:26:5: error: 'out' was not declared in this scope
   26 |     out << std::setfill('0') << std::right << std::setw(6) << P[i];
      |     ^~~
a.cc:26:63: error: 'P' was not declared in this scope
   26 |     out << std::setfill('0') << std::right << std::setw(6) << P[i];
      |                                                               ^
a.cc:27:63: error: 'num' was not declared in this scope; did you mean 'enum'?
   27 |     out << std::setfill('0') << std::right << std::setw(6) << num[i];
      |                                                               ^~~
      |                                                               enum