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

public class main {

	static int N,M;
	static int[] arr;
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		N = sc.nextInt();
		M = sc.nextInt();
		arr = new int[N];
		
		for(int i=0;i<M;i++) {
			int P = sc.nextInt();
			int Y = sc.nextInt();
			arr[P-1]++;
		}
		
		for(int i=0;i<arr.length;i++) {
			for(int j=0;j<arr[i];j++) {
				String id1 = String.format("%06d", i+1);
				String id2 = String.format("%06d", j+1);
				System.out.println(id1+id2);
			}
		}
	}

}


Compiler output:
Main.java:1: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:8: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class main
Main.java:8: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class main
3 errors
Language: Java

ffgghhgvvbbbbttSolution:ffgghhgvvbbbbttSolution:ffgghhgvvbbbbttSolution:ffgghhgvvbbbbttSolution:

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
ffgghhgvvbbbbttSolution:ffgghhgvvbbbbttSolution:ffgghhgvvbbbbttSolution:ffgghhgvvbbbbttSolution:
^
1 error
Language: C++

#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
struct node
{
	int num;
	int xian;
	int shi;
	int time;
}d[10005];
bool cmp1(node a,node b)
{
	if(a.xian<b.xian)return true;
	else if(a.xian==b.xian)
	{
		if(a.time<b.time)return true;
		else return false;
	}
	return false;
	
}
bool cmp2(node a,node b)
{
	return a.num<b.num;
}
int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=m;i++)
	{
		cin>>d[i].xian>>d[i].time;
		d[i].num=i;
	}
	sort(d+1,d+m+1,cmp1);
	int cnt=1;
	for(int i=1;i<=m;i++)
	{
		if(i!=1&&d[i].xian!=d[i-1].xian)cnt=1;
		d[i].shi=cnt;
		cnt++;
	}
	sort(d+1,d+m+1,cmp2);
	for(int i=1;i<=m;i++)
	{
		printf("%06d%06d\n",d[i].xian,d[i].shi);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   36 |         sort(d+1,d+m+1,cmp1);
      |         ^~~~
      |         sqrt
Language: C++

#include "iostream"
#include "vector"
#include "algorithm"
 
using namespace std;
 
int main()
{
  int n, m;
  cin >> n >> m;
  int p[100100], y[100100];
  for (int i = 0; i < m; i++)
  {
    cin >> p[i] >> y[i];
  }
  vector<int> yd[100100];
  for (int i = 0; i < m; i++)
  {
    yd[p[i]].push_back(y[i]);
  }
  for (int i = 0; i < n + 1; i++)
  {
    sort(yd[i].begin(), yd[i].end());
  }
  for (int i = 0; i < m; i++)
  {
    int ans_first = p[i];
    int ans_second = lower_bound(yd[p[i]].begin(), yd[p[i]].end(), y[i]) - yd[p[i]].begin() + 1;
    printf("%06d", ans_first);
    printf("%06d", ans_second);
    cout << "\n";
  }
}
#include "iostream"
#include "vector"
#include "algorithm"
 
using namespace std;
 
int main()
{
  int n, m;
  cin >> n >> m;
  int p[100100], y[100100];
  for (int i = 0; i < m; i++)
  {
    cin >> p[i] >> y[i];
  }
  vector<int> yd[100100];
  for (int i = 0; i < m; i++)
  {
    yd[p[i]].push_back(y[i]);
  }
  for (int i = 0; i < n + 1; i++)
  {
    sort(yd[i].begin(), yd[i].end());
  }
  for (int i = 0; i < m; i++)
  {
    int ans_first = p[i];
    int ans_second = lower_bound(yd[p[i]].begin(), yd[p[i]].end(), y[i]) - yd[p[i]].begin() + 1;
    printf("%06d", ans_first);
    printf("%06d", ans_second);
    cout << '\n';
  }
}

Compiler output:
a.cc:40:5: error: redefinition of 'int main()'
   40 | int main()
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main()
      |     ^~~~
Language: C++

n,m=map(int,input().split())
l=[]
k=['']*m
x=[1]*(n+1)
for i in range(m):
    a,b=map(int,input().split())
    l.append([i,a,b])
y=sorted(l,key=lambda c:c[2])
for i in y:
    k[i[0]]=str(i[1]).zfill(6)+str(x[i[1]]).zfill(6)
    x[i[1]]+=1
for i in k:
    print(i)

Compiler output:
a.cc:3:4: error: empty character constant
    3 | k=['']*m
      |    ^~
a.cc:1:1: error: 'n' does not name a type
    1 | n,m=map(int,input().split())
      | ^
Language: Java

import java.util.*;
 
public class Main{
  public static void main(){
    
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    
    HashMap<Integer, ArrayList<Integer>> h = new HashMap<Integer,ArrayList<Integer>>();
    HashMap<Integer,Integer> hm = new HashMap<Integer,Integer>();
      
    for(int i=0; i<M;i++)
    {
      int P = sc.nextInt();
      int Y = sc.nextInt();
      
      if(!h.containsKey(P))
      {
        h.put(P, new ArrayList<Integer>());
      }
      
      h.get(P).add(Y);
      hm.put(Y, i);
    }
    
    for(int key:h.keySet())
    {
      Collections.sort(h.keySet());
    }
    
    String[] ans = new String[M];
    
    for(int key:h.keySet())
    {
      String first = key+"";
      for(int i=0; i < 6-(key+"").length() ;i++)
      {
        first = "0" + first;
      }
      
      for(int i=0; i < h.get(key).size();i++)
      {
		int ind = hm.get(h.get(key).get(i));
        String second = (i+1)+"";
        
        for(int j=0;j < 6-((i-1)+"").size(); j++)
        {
          second = "0" + second;
        }
        
        ans[ind] = first+second;
      }
    }
 
    for(String an:ans)
    {
      System.out.println(an);
    }
  }
} 

Compiler output:
Main.java:30: error: no suitable method found for sort(Set<Integer>)
      Collections.sort(h.keySet());
                 ^
    method Collections.<T#1>sort(List<T#1>) is not applicable
      (cannot infer type-variable(s) T#1
        (argument mismatch; Set<Integer> cannot be converted to List<T#1>))
    method Collections.<T#2>sort(List<T#2>,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Comparable<? super T#1> declared in method <T#1>sort(List<T#1>)
    T#2 extends Object declared in method <T#2>sort(List<T#2>,Comparator<? super T#2>)
Main.java:48: error: cannot find symbol
        for(int j=0;j < 6-((i-1)+"").size(); j++)
                                    ^
  symbol:   method size()
  location: class String
2 errors
Language: Java

import java.util.*;
 
public class Main{
  public static void main(){
    
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    
    HashMap<Integer, ArrayList<Integer>> h = new HashMap<Integer,ArrayList<Integer>>();
    Hashmap<Integer,Integer> hm = new HashMap<Integer,Integer>();
      
    for(int i=0; i<M;i++)
    {
      int P = sc.nextInt();
      int Y = sc.nextInt();
      
      if(!h.containsKey(P))
      {
        h.put(P, new ArrayList<Integer>());
      }
      
      h.get(P).add(Y);
      hm.put(Y, i);
    }
    
    for(int key:h.keySet())
    {
      Collection.sort(h.keySet());
    }
    
    String[] ans = new String[M];
    
    for(int key:h.keySet())
    {
      String first = key+"";
      for(int i=0; i < 6-(key+"").length() ;i++)
      {
        first = "0" + first;
      }
      
      for(int i=0; i < h.get(key).size();i++)
      {
		int ind = hm.get(h.get(key).get(i));
        String second = (i+1)+"";
        
        for(int j=0;j < 6-((i-1)+"").size(); j++)
        {
          second = "0" + second;
        }
        
        ans[ind] = first+second;
      }
    }
 
    for(String an:ans)
    {
      System.out.println(an);
    }
  }
} 

Compiler output:
Main.java:12: error: cannot find symbol
    Hashmap<Integer,Integer> hm = new HashMap<Integer,Integer>();
    ^
  symbol:   class Hashmap
  location: class Main
Main.java:30: error: cannot find symbol
      Collection.sort(h.keySet());
                ^
  symbol:   method sort(Set<Integer>)
  location: interface Collection
Main.java:48: error: cannot find symbol
        for(int j=0;j < 6-((i-1)+"").size(); j++)
                                    ^
  symbol:   method size()
  location: class String
3 errors
Language: Java

import java.util.*;
 
public class Main{
  public static void main(){
    
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    
    HashMap<Integer, ArrayList<Integer>> h = new HashMap<Integer,ArrayList<Integer>>();
    Hashmap<Integer,Integer> hm = new HashMap<Integer,Integer>();
      
    for(int i=0; i<M;i++)
    {
      int P = sc.nextInt();
      int Y = sc.nextInt();
      
      if(!h.containkey(P))
      {
        h.put(P, new ArrayList<Integer>());
      }
      
      h.get(P).add(Y);
      hm.put(Y, i);
    }
    
    for(int key:h.keyset())
    {
      Collection.sort(h.keyset());
    }
    
    String[] ans = new String[M];
    
    for(int key:h.keySet())
    {
      String first = key+"";
      for(int i=0; i < 6-(key+"").length ;i++)
      {
        first = "0" + first;
      }
      
      for(int i=0; i < h.get(key).size;i++)
      {
		int ind = hm.get(h.get(key).get(i));
        String second = (i+1)+"";
        
        for(int j=0;j < 6-((i-1)+"").size(); j++)
        {
          second = "0" + second;
        }
        
        ans[ind] = first+second;
      }
    }
 
    for(String an:ans)
    {
      System.out.println(an);
    }
  }
} 

Compiler output:
Main.java:12: error: cannot find symbol
    Hashmap<Integer,Integer> hm = new HashMap<Integer,Integer>();
    ^
  symbol:   class Hashmap
  location: class Main
Main.java:19: error: cannot find symbol
      if(!h.containkey(P))
           ^
  symbol:   method containkey(int)
  location: variable h of type HashMap<Integer,ArrayList<Integer>>
Main.java:28: error: cannot find symbol
    for(int key:h.keyset())
                 ^
  symbol:   method keyset()
  location: variable h of type HashMap<Integer,ArrayList<Integer>>
Main.java:30: error: cannot find symbol
      Collection.sort(h.keyset());
                       ^
  symbol:   method keyset()
  location: variable h of type HashMap<Integer,ArrayList<Integer>>
Main.java:38: error: cannot find symbol
      for(int i=0; i < 6-(key+"").length ;i++)
                                 ^
  symbol:   variable length
  location: class String
Main.java:43: error: size has private access in ArrayList
      for(int i=0; i < h.get(key).size;i++)
                                 ^
Main.java:48: error: cannot find symbol
        for(int j=0;j < 6-((i-1)+"").size(); j++)
                                    ^
  symbol:   method size()
  location: class String
7 errors
Language: Java

import java.util.*;
 
public class Main{
  public static void main(){
    
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    
    HashMap<Integer, Arraylist<Integer>> h = new HashMap<Integer,Arraylist<Integer>>();
    Hashmap<Integer,Integer> hm = new HashMap<Integer,Integer>();
      
    for(int i=0; i<M;i++)
    {
      int P = sc.nextInt();
      int Y = sc.nextInt();
      
      if(!h.containkey(P))
      {
        h.put(P, new ArrayList<Integer>());
      }
      
      h.get(P).add(Y);
      hm.put(Y, i);
    }
    
    for(int key:h.keyset())
    {
      Collection.sort(h.keyset());
    }
    
    String[] ans = new String[M];
    
    for(int key:h.keyset())
    {
      string first = key+"";
      for(int i=0; i < 6-(key+"").length ;i++)
      {
        first = "0" + first;
      }
      
      for(int i=0; i < h.get(key).size;i++)
      {
		int ind = hm.get(h.get(key).get(i));
        String second = (i+1)+"";
        
        for(int j=0;j < 6-((i-1)+"").size; j++)
        {
          second = "0" + second;
        }
        
        ans[ind] = first+second;
      }
    }
 
    for(String an:ans)
    {
      System.out.println(an);
    }
  }
} 
 

Compiler output:
Main.java:11: error: cannot find symbol
    HashMap<Integer, Arraylist<Integer>> h = new HashMap<Integer,Arraylist<Integer>>();
                     ^
  symbol:   class Arraylist
  location: class Main
Main.java:11: error: cannot find symbol
    HashMap<Integer, Arraylist<Integer>> h = new HashMap<Integer,Arraylist<Integer>>();
                                                                 ^
  symbol:   class Arraylist
  location: class Main
Main.java:12: error: cannot find symbol
    Hashmap<Integer,Integer> hm = new HashMap<Integer,Integer>();
    ^
  symbol:   class Hashmap
  location: class Main
Main.java:37: error: cannot find symbol
      string first = key+"";
      ^
  symbol:   class string
  location: class Main
Main.java:38: error: cannot find symbol
      for(int i=0; i < 6-(key+"").length ;i++)
                                 ^
  symbol:   variable length
  location: class String
Main.java:48: error: cannot find symbol
        for(int j=0;j < 6-((i-1)+"").size; j++)
                                    ^
  symbol:   variable size
  location: class String
6 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(){
    
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    
    HashMap<Integer, Arraylist<Integer>> h = new HashMap<Integer,Arraylist<Integer>>();
    Hashmap<Integer,Integer> hm = new HashMap<Integer,Integer>();
      
    for(int i=0; i<M;i++)
    {
      int P = sc.nextInt();
      int Y = sc.nextInt();
      
      if(!h.containkey(P))
      {
        h.put(P, new ArrayList<Integer>());
      }
      
      h.get(P).add(Y);
      hm.put(Y, i);
    }
    
    for(int key:h.keyset())
    {
      Collection.sort(h.keyset());
    }
    
    String[] ans = new String[M];
    
    for(int key:h.keyset())
    {
      string first = key+"";
      for(int i=0; i < 6-(key+"").length ;i++)
      {
        first = "0" + first;
      }
      
      for(int i=0; i < h.get(key).size;i++)
      {
		int ind = hm.get(h.get(key).get(i));
        String second = (i+1)+"";
        
        for(int j=0;j < 6-((i-1)+"").size; j++)
        {
          second = "0" + second;
        }
        
        ans[ind] = first+second;
      }
    }

    for(an:ans)
    {
      System.out.println(an);
    }
  }
}

    
      }

      
    }

    
    

    

Compiler output:
Main.java:57: error: bad initializer for for-loop
    for(an:ans)
        ^
Main.java:65: error: class, interface, enum, or record expected
      }
      ^
2 errors
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("%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:1:10: fatal error: cstdio : No such file or directory
    1 | #include <cstdio >
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int P[100000], Y[100000], N, M;
vector <int> Z[1000001];


int main() {
	scanf_s("%d%d", &N, &M);
	for (int i = 1; i <= M; i++) {
		scanf_s("%d%d", &P[i], &Y[i]);//P1 1 P2 2 P3 1
		Z[P[i]].push_back(Y[i]);//Z_1_1 32 Z21 63 P12 12 

	}
	for (int i=1;i<=N;i++){
		sort(Z[P[i]].begin(), Z[P[i]].end());//P1x P2x すべてソート

	}
	for (int i = 1; i <= M; i++) {
		printf("%06d%06d\n", P[i], lower_bound(Z[P[i]].begin(),Z[P[i]].end(),Y[i])-Z[P[i]].begin()+1);
		
		//Y[i]をイテレータとしてlower_boundで探す。これ	だけだとY年を表示してしまうので、beginを引くわけだ　つまり
		//printf("%d%d\n", P[i], int(lower_bound(Z[P[i]].begin(), Z[P[i]].end(), Y[i])));→
		//printf("%d%d\n", P[i], int(lower_bound(Z[P[i]].begin(), Z[P[i]].end(), Y[i])) - Z[P[i]].begin() + 1);
	}

}

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

#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int P[100000], Y[100000], N, M;
vector <int> Z[1000001];


int main() {
	scanf_s("%d%d", &N, &M);
	for (int i = 1; i <= M; i++) {
		scanf_s("%d%d", &P[i], &Y[i]);//P1 1 P2 2 P3 1
		Z[P[i]].push_back(Y[i]);//Z_1_1 32 Z21 63 P12 12 

	}
	for (int i=1;i<=N;i++){
		sort(Z[P[i]].begin(), Z[P[i]].end());//P1x P2x すべてソート

	}
	for (int i = 1; i <= M; i++) {
		printf("%d%d\n", P[i], lower_bound(Z[P[i]].begin(),Z[P[i]].end(),Y[i])-Z[P[i]].begin()+1);
		
		//Y[i]をイテレータとしてlower_boundで探す。これ	だけだとY年を表示してしまうので、beginを引くわけだ　つまり
		//printf("%d%d\n", P[i], int(lower_bound(Z[P[i]].begin(), Z[P[i]].end(), Y[i])));→
		//printf("%d%d\n", P[i], int(lower_bound(Z[P[i]].begin(), Z[P[i]].end(), Y[i])) - Z[P[i]].begin() + 1);
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |         scanf_s("%d%d", &N, &M);
      |         ^~~~~~~
      |         scanf
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 ) 
for(int i=0;i<M;i++){
    scanf ("% d % d " ,& P [ i ] ,& Y [ i ]) ;
     yd [ P [ i ]]. push_back ( Y [ i ]);
}
//yd 
rep (i , N ) sort ( yd [ i +1]. begin () , yd [ i +1]. end ());
for (int i=0; i< M;i++ ) {
    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);
//lower_bnd Y[i]以上のイテレータを返す

}

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

#include <iostream>
#include <vector>
#include <cmath>
#include <map>

using namespace std;

int main(int argc, const char * argv[]) {
    int N;
    int M;
    int P[100001];
    int Y[100001];
    vector<int> v[100001];
    
    cin >> N >> M;
    for (int i = 0; i < M; i++) {
        cin >> P[i] >> Y[i];
        v[P[i]].push_back(Y[i]);
    }
    
    for (int i = 0; i < N; i++) {
        sort(v[P[i]].begin(), v[P[i]].end());
    }
    
    map<int, int> m;
    for (int i = 0; i < M; i++) {
        int count = 1;
        for (int j = 0; j < v[P[i]].size(); j++) {
            m[v[P[i]][j]] = count++;
        }
    }
    
    for (int i = 0; i < M; i++) {
        printf("%06d%06d\n", P[i], m[Y[i]]);
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   22 |         sort(v[P[i]].begin(), v[P[i]].end());
      |         ^~~~
      |         sqrt
Language: Java

import java.util.Scanner;


public class cityname {
	int location = 0;
	int year = 0;
}

class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		
		cityname[] city = new cityname[3];
		
		for (int i = 0; i < M ;i++){
			city[i] =  new cityname();
		}
		
		for (int i = 0; i < M ;i++){
			city[i].location = scan.nextInt();
			city[i].year = scan.nextInt();
		}
		
		for  (int i = 0; i < M ;i++){
			int index =1 ;
	
			for  (int j = 0; j < M ;j++){
				if( (city[i].location == city[j].location) && (city[i].year > city[j].year)){
					index++;
				}
			}	
			System.out.println(String.format("%06d", city[i].location)+String.format("%06d", index));
		}
	}
}


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

#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;

int main(){
	int N , M;
	cin >> N >> M;
	vector<P> PY(M),py(M);
	for(int i=0;i<M;i++){
		cin >> PY[i].first >> PY[i].second;
		py[i] = PY[i];
	}
	sort(py.begin(),py.end());
	map<P , int> ans;
	int pre = py[0].first;
	int index = 0;
	for(int i=0;i<M;i++){
		if(pre == py[i].first){
			index++;
			ans[py[i]] = index;
		}else{
			index = 1;
			pre = py[i].first;
			ans[py[i]] = index;
		}
	}
	for(int i=0;i<M;i++)printf("06%d06%d\n",PY[i].first , ans[PY[i]]);
	return 0;
}s


Compiler output:
a.cc:29:2: error: 's' does not name a type
   29 | }s
      |  ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<utility>
#include<map>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 1e18
#define MOD 100000007
#define SIZE 100005
#define PI 	3.14159265358979323846
int N,M;
pair<ll,pair<int,int>> PY_set[1e5];
//作成年(ll)→M市に位置→入力順
pair<int,int> PY_ans[1e5];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> M;
    REP(i,M){
        cin >> PY_set[i].second.first >> PY_set[i].first;
        PY_set[i].second.second = i;
    }
    sort(PY_set,PY_set+M);//作成年順にソート

    //REP(i,M)cout << PY_set[i].first << endl;
    //REP(i,M)cout << PY_set[i].second.first << endl;

    int last_sorted = 0;
    REP(i,M){
        if(PY_set[i].first != PY_set[i+1].first){
            sort(PY_set+last_sorted,PY_set+i);//市順にソート
        }
    }
    //REP(i,M)cout << PY_set[i].first << endl;
    //REP(i,M)cout << PY_set[i].second.first << endl;
    int roop = 0;
    REP(i,M){
        if(i != 0){
            if(PY_set[i].second.first == PY_set[i-1].second.first){
                roop++;
            }else{
                roop = 0;
            }
        }
        PY_ans[PY_set[i].second.second].first = PY_set[i].second.first;
        PY_ans[PY_set[i].second.second].second = roop;
    }
    REP(i,M){
        printf("%06d%06d\n",PY_ans[i].first,PY_ans[i].second+1);
    }
    return 0;
}

Compiler output:
a.cc:28:31: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   28 | pair<ll,pair<int,int>> PY_set[1e5];
      |                               ^~~
a.cc:28:31: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
   28 | pair<ll,pair<int,int>> PY_set[1e5];
      |                               ^~~
      |                               |
      |                               double
a.cc:28:31: error: size of array 'PY_set' has non-integral type 'double'
a.cc:30:22: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   30 | pair<int,int> PY_ans[1e5];
      |                      ^~~
a.cc:30:22: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
   30 | pair<int,int> PY_ans[1e5];
      |                      ^~~
      |                      |
      |                      double
a.cc:30:22: error: size of array 'PY_ans' has non-integral type 'double'
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> Pi;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
int main(){
    int N,M;
    cin >> N >> M;
    vector<int>P(M),Y(M);
    vector<vector< Pi > > table(N);
    rep(i,0,M){
        cin >> P[i] >> Y[i];
    }
    rep(i,0,M){
        table[P[i] - 1].push_back( Pi(Y[i],i) );
    }
    rep(i,0,N){
        sort(table[i].begin(), table[i].end());
    }
    vector<string> ans(M);
    rep(i,0,N){
        rep(j,0,table[i].size()){
        //for(auto p:table[i]){
            //cout << p.first << endl;
            //for(auto p:v){
                Pi p = table[i][j];
                stringstream ss1,ss2;
                string s1,s2;
                ss1 << setw(6) << setfill('0') << (i + 1);
                ss2 << setw(6) << setfill('0') << (j + 1);
                s1 = ss1.str();
                s2 = ss2.str();
                ans[p.second] = s1 + s2;
            //}
        }
    }
    rep(i,0,M){
        cout << ans[i] << endl;
    }
    }
}

Compiler output:
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;
/* constant */
const int inf = pow(2, 62);
const int mod = 1e9 + 7;
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};
/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}
 
/* general_method */
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 
/* main */
int digitlen(int n){
    int cnt = 0;
    while(n){
        cnt++;
        n /= 10;
    }
   return cnt;
}
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
   std::ostringstream sout;
    int n, m; cin >> n >> m;
    vector<vec<pi>> arr(n + 5);
    rep(i,0,m){
       int p, y; cin >> p >> y;
        arr[p].push_back(make_pair(y, i));
    }
    rep(i,0,n + 5){
        if(not arr[i].empty()) sort(all(arr[i]));
   }
   vec<pi> ans(m + 5, pi(0,0));
   rep(i,0,arr.size()){
        if(not arr[i].empty()){
            rep(j,0,arr[i].size()){
               pi tmp = arr[i][j];
                ans[tmp.second] = make_pair(i, j + 1);
            }
        }
    }
    
   for(auto e : ans){
        if(e != pi(0, 0)){
            printf("%06lld%06lld\n", e.first, e.second);
        }
   }


Compiler output:
a.cc: In function 'int main()':
a.cc:71:5: error: expected '}' at end of input
   71 |    }
      |     ^
a.cc:44:14: note: to match this '{'
   44 | signed main(){
      |              ^
Language: C

#include <stdio.h>
#include<stdlib.h>
void MergeSort(int x[ ], int left, int right);
int main(){
  int n,m,i,j,k;
  scanf("%d %d",&n,&m);
  int p[m],y[m],x[m],yet[m];
  for(i=0;i<m;i++){
    scanf("%d %d",&p[i],&y[i]);
    x[i]=1;
    yet[i]=0;
  }

  int count,same[n],temp;
  for(j=0;j<m;j++){
    if(yet[j]==0){
      yet[j]=1;
      count = 0;
      same[0]=j;
      for(i=j+1;i<m;i++){
        if(p[i]==p[j]){
          yet[i]=1;
          count+=1;
          same[count]=i;
        }
      }

      if(count>0){
        for(i=0;i<count+1;i++){
          for(k=count;k>i;k--){
            if(y[same[k]]<y[same[k-1]]){
              temp=same[k];
              same[k]=same[k-1];
              same[k-1]=temp;
            }
          }
        }
        for(i=0;i<count+1;i++){
          x[same[i]]=i+1;
        }
      }


    }
  }

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

void MergeSort(int x[ ], int left, int right)
{
    int mid, i, j, k;

    if (left >= right)              /* 配列の要素がひとつなら */
        return;                     /* 何もしないで戻る */

                                    /* ここでは分割しているだけ */
    mid = (left + right) / 2;       /* 中央の値より */
    MergeSort(x, left, mid);        /* 左を再帰呼び出し */
    MergeSort(x, mid + 1, right);   /* 右を再帰呼び出し */

      /* x[left] から x[mid] を作業領域にコピー */
    for (i = left; i <= mid; i++)
        temp[i] = x[i];

      /* x[mid + 1] から x[right] は逆順にコピー */
    for (i = mid + 1, j = right; i <= right; i++, j--)
        temp[i] = x[j];

    i = left;         /* i とj は作業領域のデーターを */
    j = right;        /* k は配列の要素を指している */

    for (k = left; k <= right; k++)    /* 小さい方から配列に戻す */
        if (temp[i] <= temp[j])        /* ここでソートされる */
            x[k] = temp[i++];
        else
            x[k] = temp[j--];
}


Compiler output:
main.c: In function 'MergeSort':
main.c:67:9: error: 'temp' undeclared (first use in this function); did you mean 'mktemp'?
   67 |         temp[i] = x[i];
      |         ^~~~
      |         mktemp
main.c:67:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define p pair<int,int>
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }

unsigned int randxor()
{
	static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	unsigned int t;
	t = (x ^ (x << 11)); x = y; y = z; z = w; return(w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	vector<int> k(m), y(m);
	vector<vector<int>> x(n);
	rep(i, m) {
		//cin >> k[i] >> y[i];
		scanf_s("%d %d", k[i], y[i]);
		k[i]--;
		x[k[i]].push_back(y[i]);
	}
	rep(i, n) {
		vector<int> z = x[i];
		sort(z);
		x[i] = z;
	}
	rep(i, m) {
		int a = k[i] + 1;
		vector<int> z = x[k[i]];
		int b = (lower_bound(z.begin(), z.end(), y[i]) - z.begin()) + 1;
		printf("%06d%06d\n", a, b);

	}

}


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

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define p pair<int,int>
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }

unsigned int randxor()
{
	static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	unsigned int t;
	t = (x ^ (x << 11)); x = y; y = z; z = w; return(w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}


int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	vector<int> k(m), y(m);
	vector<vector<int>> x(n);
	rep(i, m) {
		scanf_s("%d %d", &k[i], &y[i]);
		k[i]--;
		x[k[i]].push_back(y[i]);
	}
	rep(i, n) {
		vector<int> z = x[i];
		sort(z);
		x[i] = z;
	}
	rep(i, m) {
		int a = k[i] + 1;
		vector<int> z = x[k[i]];
		int b = (lower_bound(z.begin(), z.end(), y[i]) - z.begin()) + 1;
		printf("%06d%06d\n", a, b);

	}

}


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

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define p pair<int,int>
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }

unsigned int randxor()
{
	static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	unsigned int t;
	t = (x ^ (x << 11)); x = y; y = z; z = w; return(w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	vector<int> k(m), y(m);
	vector<vector<int> > x(n);
	rep(i, m) {
		scanf_s("%d %d", &k[i], &y[i]);
		k[i]--;
		x[k[i]].push_back(y[i]);
	}
	rep(i, n) {
		vector<int> z = x[i];
		sort(z);
		x[i] = z;
	}
	rep(i, m) {
		int a = k[i] + 1;
		vector<int> z = x[k[i]];
		int b = (lower_bound(z.begin(), z.end(), y[i]) - z.begin()) + 1;
		printf("%06d%06d\n", a, b);

	}

}


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

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define p pair<int,int>
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }

unsigned int randxor()
{
	static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	unsigned int t;
	t = (x ^ (x << 11)); x = y; y = z; z = w; return(w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	vector<int> k(m), y(m);
	vector<vector<int>> x(n);
	rep(i, m) {
		scanf_s("%d %d", &k[i], &y[i]);
		k[i]--;
		x[k[i]].push_back(y[i]);
	}
	rep(i, n) {
		vector<int> z = x[i];
		sort(z);
		x[i] = z;
	}
	rep(i, m) {
		int a = k[i] + 1;
		vector<int> z = x[k[i]];
		int b = (lower_bound(z.begin(), z.end(), y[i]) - z.begin()) + 1;
		printf("%06d%06d\n", a, b);

	}

}


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

#include <iostream>
#include <ios>     // std::left, std::right
#include <iomanip> // std::setw(int), std::setfill(char)

#include <algorithm>
#include <cstdlib>  // abs() for integer
#include <vector>
using namespace std;

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


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

//    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 ("%012lld\n" , ll (P[i]) * 1000000 + int ( lower_bound ( yd[P[i]].begin() , yd [P[i]].end() ,Y[i]) - yd[P[i]].begin()) + 1);


    /* 以下、TLE出まくったうんこ回答 */
    int N,M;
    cin >> N >> M;

    int P, Y;

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

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

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

    for(int i=1; i<M+1; i++){
        //　何番か求める
        int num = 0;
        for(int tmp=1; tmp<M+1; tmp++){
            if(pairs[tmp].first == original_pairs[i].first && pairs[tmp].second == original_pairs[i].second){
                j=tmp;
                break;
            }
        }

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

//        cout  << setfill('0') << setw(6) << original_pairs[i].first << setfill('0') << setw(6) << num << '\n';
        printf ("%012lld\n" , ll (original_pairs[i].first) * 1000000 + int (num));
    }






}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:16: error: 'pairs' was not declared in this scope
   50 |             if(pairs[tmp].first == original_pairs[i].first && pairs[tmp].second == original_pairs[i].second){
      |                ^~~~~
a.cc:51:17: error: 'j' was not declared in this scope
   51 |                 j=tmp;
      |                 ^
a.cc:56:25: error: 'j' was not declared in this scope
   56 |         for(int k=1; k<=j; k++){
      |                         ^
a.cc:57:16: error: 'pairs' was not declared in this scope
   57 |             if(pairs[k].first == pairs[j].first){
      |                ^~~~~
Language: C

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

int main(void) {
  typedef struct t_city_node {
    int state;
    int year;
    int seq_id;
  } t_city;

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

  t_city city_list[100000];
  for(int i = 0; i < M; i++) {
    scanf("%d %d", &city_list[i].state, &city_list[i].year);
    idx[i] = i;
  }

  // sort by year
  for(int i = 0; i < M; i++) {
    for(int j = 0; j < i; j++) {
      if(city_list[i].year > city_list[j].year) {
	t_city tmp;
	tmp.state = city_list[i].state;
	tmp.year  = city_list[i].year;
	city_list[i].state = city_list[j].state;
	city_list[i].year  = city_list[j].year;
	city_list[j].state = tmp.state;
	city_list[j].year  = tmp.year
      }
    }
  }

  // set seq_id
  int city_id[100000];
  memset(city_id,  0, sizeof(int)*100000);
  for(int i = 0; i < M; i++) {
    int state = city_list[idx[i]].state;
    city_list[idx[i]].seq_id = city_id[state]++;
  }
    
  // final output
  for(int i = 0; i < M; i++) {
    printf("%06d%06d\n", city_list[i].state, city_list[i].seq_id);
  }

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:5: error: 'idx' undeclared (first use in this function)
   18 |     idx[i] = i;
      |     ^~~
main.c:18:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:38: error: expected ';' before '}' token
   31 |         city_list[j].year  = tmp.year
      |                                      ^
      |                                      ;
   32 |       }
      |       ~
Language: C++

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

struct tag
{
  int ni;
  int nid;
  int p;
  int y;
}

int main()
{
  int n, m;
  cin >> n >> m;
  tag *d = new tag[m];
  for( int i = 0; i < m; i++)
  {
    d[i].ni = i;
    cin >> d[i].p >> d[i].y;
  }
  sort(d, d + m, [](const tag& l, const tag& r){return l.y < r.y;});
  
  int *ns = new int[n]();
  for( int i = 0; i < m; i++)
  {
    d[i].nid = ++ns[d[i].p - 1];
  }
  sort(d, d + m, [](const tag& l, const tag& r){return l.ni < r.ni;});
  
  for(int i = 0; i < m; i++)
  {
    printf("%06d%06d\n", d[i].p, d[i].nid);
  }
}


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

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

struct tag
{
  int ni;
  int nid;
  int p;
  int y;
}

int main()
{
  int n, m;
  cin >> n >> m;
  tag *d = new tag[m];
  for( int i = 0; i < m; i++)
  {
    d[i].ni = i;
    cin >> d[i].p >> d[i].y;
  }
  sort(d, d + m, [](const tag& l, const tag& r){return l.y < r.y});
  
  int *ns = new int[n]();
  for( int i = 0; i < m; i++)
  {
    d[i].nid = ++ns[d[i].p - 1];
  }
  sort(d, d + m, [](const tag& l, const tag& r){return l.ni < r.ni});
  
  for(int i = 0; i < m; i++)
  {
    printf("%06d%06d\n", d[i].p, d[i].nid);
  }
}

Compiler output:
a.cc:12:2: error: expected ';' after struct definition
   12 | }
      |  ^
      |  ;
a.cc: In lambda function:
a.cc:24:65: error: expected ';' before '}' token
   24 |   sort(d, d + m, [](const tag& l, const tag& r){return l.y < r.y});
      |                                                                 ^
      |                                                                 ;
a.cc: In lambda function:
a.cc:31:67: error: expected ';' before '}' token
   31 |   sort(d, d + m, [](const tag& l, const tag& r){return l.ni < r.ni});
      |                                                                   ^
      |                                                                   ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define     __        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define     pi        acos(-1)
#define     ll        long long int
#define     fopen     freopen("in.txt","r",stdin)
#define     fwrite    freopen("o.txt","w",stdout)
#define     f0(n)     for(int i=0;i<n;i++)
#define     mem(a)    memset(a,0,sizeof(a))
#define     mems(a)   memset(a,-1,sizeof(a))
int buck[1111];
int main()
{

        int n,m,p,y;
    cin>>n>>m;
    vector<int>v[n+1];
    int a[m],b[m];
    set<int>sset;
    f0(m){
        cin>>p>>y;
        a[i]=p,b[i]=y;
        v[p].push_back(y);
        sset.insert(p);
    }
    for(set<int>:: iterator i=sset.begin();i!=sset.end();i++)
    {
        int p=*i;
        sort(v[p].begin(),v[p].end());
    }
   for(int i=0;i<m;i++)
   {
       stringstream ss;
       ss<<a[i];
       string s=ss.str();
       for(int j=0;j<(6-s.size());j++) cout<<0;
       cout<<s;
       int l=lower_bound(v[a[i]].begin(),v[a[i]].end(),b[i])-v[a[i]].begin();
       l+=1;
       stringstream sd;
       sd<<l;
       string s1=sd.str();
       for(int j=0;j<(6-s1.size());j++) cout<<0;
       cout<<s1<<endl;
   }

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

#include <iostream>
#include <ios>     // std::left, std::right
#include <iomanip> // std::setw(int), std::setfill(char)

#include <algorithm>
#include <cstdlib>  // abs() for integer
#include <vector>
using namespace std;

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


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

    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 ("%012lld\n" , ll (P[i]) * 1000000 + int ( lower_bound ( yd[P[i]].begin() , yd [P[i]].end() ,Y[i]) ) + 1);


    /* 以下、TLE出まくったうんこ回答 */
//    int N,M;
//    cin >> N >> M;
//
//    int P, Y;
//
////    vector<pair<int, int> > pairs(M+1);
//    vector<pair<int, int> > original_pairs(M+1);
//
//    for(int i=1; i<M+1; i++){
//        cin >> P >> Y;
//        original_pairs[i] = make_pair(P, Y);
//    }
//
////    sort(pairs.begin(), pairs.end());
//
//    for(int i=1; i<M+1; i++){
//        //　何番か求める
//        int num = 0;
////        for(int tmp=1; tmp<M+1; tmp++){
////            if(pairs[tmp].first == original_pairs[i].first && pairs[tmp].second == original_pairs[i].second){
////                j=tmp;
////                break;
////            }
////        }
//
////        for(int k=1; k<=j; k++){
////            if(pairs[k].first == pairs[j].first){
////                num++;
////            }
////        }
//        for(int j=1; j<M+1; j++){
//            if(original_pairs[i].first == original_pairs[j].first && original_pairs[i].second > original_pairs[j].second){
//                num++;
//            }
//        }
//
//        cout  << setfill('0') << setw(6) << original_pairs[i].first << setfill('0') << setw(6) << num << '\n';
//    }






}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:59: error: invalid cast from type '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to type 'int'
   26 |     rep(i ,M) printf ("%012lld\n" , ll (P[i]) * 1000000 + int ( lower_bound ( yd[P[i]].begin() , yd [P[i]].end() ,Y[i]) ) + 1);
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
	int N , M;
	cin >> N >> M;
	vector<pair<int,int>> PY(M),py(M);
	for(int i=0;i<M;i++){
		cin >> PY[i].first >> PY[i].second;
		py[i] = PY[i];
	}
	sort(py.begin(),py.end());
	ans[1000000001];
	int pre = PY[0].first;
	int index = 0;
	for(int i=0;i<M;i++){
		if(pre == PY[i].first){
			index++;
			ans[PY[i].second] = index;
		}else{
			index = 1;
			pre = PY[i].first;
			ans[PY[i].second] = index;
		}
	}
	for(int i=0;i<M;i++)printf("06%d06%d\n",py[i].first , ans[py[i].second]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |         ans[1000000001];
      |         ^~~
      |         abs
Language: C++

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

int main(){
	int N , M;
	cin >> N >> M;
	vector<pair<int,pair<int,int>> PY(M);
	for(int i=0;i<M;i++){
		cin >> PY[i].first >> PY[i].second.first;
		PY[i].second.second = i;
	}
	sort(PY.begin(),PY.end());
	long long int ans[M];
	int pre = PY[0].first;
	int index = 0;
	for(int i=0;i<M;i++){
		if(pre == PY[i].first){
			index++;
		}else{
			index = 1;
			pre = PY[i].first;
		}
		int j = PY[i].second.second;
		long long ANS = PY[i].first*1000000 + index;
		ans[j] = ANS;
	}
	for(int i=0;i<M;i++)printf("012%lld\n",ans[i]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:44: error: template argument 1 is invalid
    8 |         vector<pair<int,pair<int,int>> PY(M);
      |                                            ^
a.cc:8:44: error: template argument 2 is invalid
a.cc:10:24: error: 'PY' was not declared in this scope
   10 |                 cin >> PY[i].first >> PY[i].second.first;
      |                        ^~
a.cc:13:14: error: 'PY' was not declared in this scope
   13 |         sort(PY.begin(),PY.end());
      |              ^~