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

#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main(){
    ll n , m ;
    cin >> n >> m ;
    
    ll p[m] , q[m] ;
    for(int i = 0 ; i < m ; i++){
        cin >> p[i] >> q[i] ;
    }

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

    

    return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'i' was not declared in this scope
   26 |         sort(yd[i+1].begin(),yd[i+1].end());
      |                 ^
a.cc:29:90: error: 'y' was not declared in this scope
   29 |         printf ("%012lld\n",ll(p[i])*1000000+lower_bound(yd[p[i]].begin(),yd[p[i]].end(),y[i])-yd[p[i]].begin()+1);
      |                                                                                          ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    ArrayList[] year = new ArrayList[n];
    for(int i = 0; i < n; i++) {
      year[i] = new ArrayList<Integer>();
    }
    int[] p = new int[m];
    int[] y = new int[m];
    HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
    for(int i = 0; i < m; i++) {
      p[i] = sc.nextInt() - 1;
      y[i] = sc.nextInt();
      year[p[i]].add(y[i]);
    }
    for(int i = 0; i < n; i++) {
      Collections.sort(year[i]);
      for(int j = 0; j < year[i].size(); j++) {
        map.put(year[i].get(j), j + 1);
      }
    }
    for(int i = 0; i < m; i++) {
      p[i]++;
      String s1 = String.valueOf(p[i]);
      String ans1 = p[i];
      for(int j = 0; j < 6 - s1.length(); j++) {
        ans1 = "0" + ans1;
      }
      int t2 = map.get(year[i]);
      String s2 = String.valueOf(t2);
      String ans2 = s2;
      for(int j = 0; j < 6 - s2.length(); j++) {
        ans2 = "0" + ans2;
      }
      System.out.println(ans1 + ans2);
    }
  }
}


Compiler output:
Main.java:23: error: incompatible types: Object cannot be converted to Integer
        map.put(year[i].get(j), j + 1);
                           ^
Main.java:29: error: incompatible types: int cannot be converted to String
      String ans1 = p[i];
                     ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: C++

#include <iostream>
#include<sstream>
#include<string>
#include<vector>
#include <cmath>
#include <limits>
#include <queue>
#include<algorithm>
#include <map>
#include <stack>
#include <iomanip>
 
using namespace std;
 
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
 
 
int binarySearch(vector<int > v, int target){
  int l = 0, r = v.size();
  int mid;
  while (l+1<r){
    mid = (r+l)/2;
    if (v[mid] <= target){
      l = mid;
    }
    else r = mid;
  }
  return l;
}
 
 
int main(){
  int n, m;
  cin >> n >> m;
  int p[m];
  long long y[m];
  vector<long long> id[n];
  rep(i,m){
    cin >> p[i] >> y[i];
    id[p[i]-1].push_back(y[i]);
  }
  rep(i,n){
    sort(id[i].begin(),id[i].end());
  }
 
  int res;
  rep(i,m){
    res = binarySearch(id[p[i]-1],y[i]);
    cout<< setfill('0') << setw(6)  << p[i];
    cout << setfill('0') << setw(6)  << res+1 << endl;
  }  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:33: error: could not convert 'id[(p[i] - 1)]' from 'vector<long long int>' to 'vector<int>'
   48 |     res = binarySearch(id[p[i]-1],y[i]);
      |                        ~~~~~~~~~^
      |                                 |
      |                                 vector<long long int>
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<cstdio>
#include<utility>
using namespace std;
#define rep(i,x,n) for(int i=x;i<n;i++)
using ll=long long;

int N,M;
int P[100000],Y[100000];
vector<int> idy[100000];


int main(){
    cin>>N>>M;
    rep(i,0,M){
        cin>>P[i]>>Y[i];
        idy[P[i]].push_back(Y[i]);
    }
    rep(i,0,N){
        sort(idy[i].begin(),idy[i].end());
    }
    rep(i,0,M){
        printf("%06d",P[i]);
        int x=(int)(lower_bound(idy[P[i]].begin(),idy[P[i]].end(),Y[i])-idy[P[i]].begin())+1;
        printf("%06d\n",x);
    }
    return 0;
}

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

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

int N, M;
int P[1000000], Y[1000000];
vector<int> 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(yd[i + 1].begin(), yd[i + 1].end());
  rep(i, M) cout << ll(P[i]) * 100000 + int(lower_bound(yd[P[i]].begin(), yd[P[i]].end(), Y[i]) - yd[P[i]].begin()) + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |   rep(i, N) sort(yd[i + 1].begin(), yd[i + 1].end());
      |             ^~~~
      |             short
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: In function 'int main()':
a.cc:6:14: error: 'i' was not declared in this scope
    6 | #define rep (i , n ) for ( int i =0; i < n ; i ++)
      |              ^
a.cc: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:18: 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++

n, m = map(int, input().split())
py_dict = dict()
ip_dict = dict()

for i in range(m):
    py_list = list(map(int, input().split()))
    py_list.append(i)
    if py_list[0] in py_dict:
        py_dict[py_list[0]].append(py_list)
    else:
        py_dict[py_list[0]] = [py_list]
    ip_dict[i] = py_list[0]

for item in py_dict:
    tmp_list = py_dict[item]
    tmp_list.sort(key=lambda x: x[1])
    for i in range(len(tmp_list)):
        tmp_list[i].append(i+1)
    tmp_list.sort(key=lambda x: x[2])

for i in range(m):
    p = ip_dict[i]
    t_list = py_dict[p].pop(0)
    b = t_list[3]
    print(str(p).zfill(6) + str(b).zfill(6))


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

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

string f(int n) {
  int x = n;
  string s = to_string(x);
  int keta = 0;
  while(x>0) {
    keta++;
    x /= 10;
  }
  if(keta==1) s = "00000" + s;
  if(keta==2) s = "0000" + s;
  if(keta==3) s = "000" + s;
  if(keta==4) s = "00" + s;
  if(keta==5) s = "0" + s;
  return s;
}

int main() {
  ll n, m;
  cin >> n >> m;
  vector<vector<ll>> vec(100010, vector<ll>());
  vector<P> ve(m);
  rep(i,m) {
    ll p, y;
    cin >> p >> y;
    ve[i].first = p;
    ve[i].second = y;
    vec[p].push_back(y);
  }
  rep(i,100010) sort(vec[i].begin(), vec[i].end());
  rep(i,m) {
    string s = f(ve[i].first);
    int d;
    d = (int)(lower_bound(vec[ve[i].first].begin(), vec[ve[i].first].end(), ve[i].second) - vec[ve[i].first].begin())+1);
    string t = f(d);
    cout << s + t << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:120: error: expected ';' before ')' token
   39 |     d = (int)(lower_bound(vec[ve[i].first].begin(), vec[ve[i].first].end(), ve[i].second) - vec[ve[i].first].begin())+1);
      |                                                                                                                        ^
      |                                                                                                                        ;
Language: C++

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

string f(int n) {
  int x = n;
  string s = to_string(x);
  int keta = 0;
  while(x>0) {
    keta++;
    x /= 10;
  }
  if(keta==1) s = "00000" + s;
  if(keta==2) s = "0000" + s;
  if(keta==3) s = "000" + s;
  if(keta==4) s = "00" + s;
  if(keta==5) s = "0" + s;
  return s;
}

int main() {
  ll n, m;
  cin >> n >> m;
  vector<vector<ll>> vec(100000, vector<ll>());
  vector<P> ve(m);
  rep(i,m) {
    ll p, y;
    cin >> p >> y;
    ve[i].first = p;
    ve[i].second = y;
    vec[p].push_back(y);
  }
  rep(i,100000) sort(vec[i].begin(), vec[i].end());
  rep(i,m) {
    string s = f(ve[i].first);
    int d;
    rep(j,vec[ve[i].first].size()) {
      if(vec[ve[i].first][j] == ve[i].second) {
        d = j;
        break;
      }
    }
 

Compiler output:
a.cc: In function 'int main()':
a.cc:44:6: error: expected '}' at end of input
   44 |     }
      |      ^
a.cc:36:12: note: to match this '{'
   36 |   rep(i,m) {
      |            ^
a.cc:44:6: error: expected '}' at end of input
   44 |     }
      |      ^
a.cc:23:12: note: to match this '{'
   23 | int main() {
      |            ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include < cstdio >
#include < vector >
#include < algorithm >
using namespace std;
typedef long long ll;
#define rep(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(M) scanf("%d %d", &P[i], &Y[i]), yd[P[i]].push_back(Y[i]);
	rep(N) sort(yd[i + 1].begin(), yd[i + 1].end());
	rep(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:2:10: fatal error:  cstdio : No such file or directory
    2 | #include < cstdio >
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

Compiler output:
a.cc: 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 <algorithm>
#include <functional>
#include <array>
#include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;
int main(void) {
	int n, m, a, b;
	vector<int>data;
	vector<int>data2;
	cin >> n, cin >> m;
	for (int i = 0; i < n;i++)data.push_back(0);
	for (int i = 0; i < m; i++) {
		cin >> a;
		cin >> b;
		data[a - 1]++;
	}
	int t, max = 0;
	for (int i = 0; i < m; i++) {
		for (int i2 = 0; i2 < n; i2++) {
			if (max <= data[i2])max = data[i2], t = i2 + 1;
		}
		printf("%06d%06d\n", t, max);
		max = 0;
		data[i2 + 1]--;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: 'i2' was not declared in this scope; did you mean 'i'?
   26 |                 data[i2 + 1]--;
      |                      ^~
      |                      i
Language: C++

//
// Created by Hideaki Imamura on 2020-03-15.
//
# include <bits/stdc++.h>

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

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

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

# define EPS (1e-7)
# define INF (1e9)
# define PI (acos(-1))
//const ll mod = 1000000007;

ll N, M;
vector<ll> P, Y;

int main() {
    cin >> N >> M;
    for (int i = 0; i < M; ++i) {
        ll p, y;
        cin >> p >> y;
        P.push_back(p-1);
        Y.push_back(y);
    }

    vector<vector<ll>> vals(N);
    for (int i = 0; i < M; ++i) vals[P[i]].push_back(Y[i]);

    for (int v = 0; v < N; ++v) {
        sort(vals[v].begin(), vals[v].end());
        vals[v].erase(unique(vals[v].begin(), vals[v].end()), vals[v].end());
    }

    for (int i = 0; i < M; ++i) {
        ll v = P[i];
        printf("%06d", v + 1);
        inf id = lower_bound(vals[v].begin(), vals[v].end(), Y[i]) - vals[v].begin();
        printf("06d\n", id + 1);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:9: error: 'inf' was not declared in this scope; did you mean 'ynf'?
   57 |         inf id = lower_bound(vals[v].begin(), vals[v].end(), Y[i]) - vals[v].begin();
      |         ^~~
      |         ynf
a.cc:58:25: error: 'id' was not declared in this scope; did you mean 'i'?
   58 |         printf("06d\n", id + 1);
      |                         ^~
      |                         i
Language: C++

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

struct city
{
  // 誕生年, 入力された順番
  int64_t year;
  int in_order;
};

int main()
{
  int n, m;
  cin >> n >> m;
  vector<city> prefecture(n);
  for (int i = 0; i < m; ++i)
  {
    int p;
    int64_t y;
    cin >> p >> y;
    prefecture[p].push_back({y, i+1});
  }

  // 県ごとに誕生年でソート
  for (int i = 1; i < n; ++i)
  {
    if (prefecture[i].empty()) continue;
    sort(prefecture[i].begin(), prefecture[i].end(), [](const city &x, const city &y) {
      return x.year < y.year;
    });
  }

  vector<int64_t> id_upper(m + 1), id_bottom(m + 1);
  for (int i = 1; i <= n; ++i)
  {
    for (int j = 0, s = (int)prefecture[i].size(); j < s; ++j)
    {
      id_upper[prefecture[i][j].in_order] = i;
      id_bottom[prefecture[i][j].in_order] = j + 1;
    }
  }

  for (int i = 1; i <= m; ++i)
    cout << setfill('0') << right << setw(6) << id_upper[i] << setfill('0') << right << setw(6) << id_bottom[i] << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: '__gnu_cxx::__alloc_traits<std::allocator<city>, city>::value_type' {aka 'struct city'} has no member named 'push_back'
   21 |     prefecture[p].push_back({y, i+1});
      |                   ^~~~~~~~~
a.cc:27:23: error: '__gnu_cxx::__alloc_traits<std::allocator<city>, city>::value_type' {aka 'struct city'} has no member named 'empty'
   27 |     if (prefecture[i].empty()) continue;
      |                       ^~~~~
a.cc:28:24: error: '__gnu_cxx::__alloc_traits<std::allocator<city>, city>::value_type' {aka 'struct city'} has no member named 'begin'
   28 |     sort(prefecture[i].begin(), prefecture[i].end(), [](const city &x, const city &y) {
      |                        ^~~~~
a.cc:28:47: error: '__gnu_cxx::__alloc_traits<std::allocator<city>, city>::value_type' {aka 'struct city'} has no member named 'end'
   28 |     sort(prefecture[i].begin(), prefecture[i].end(), [](const city &x, const city &y) {
      |                                               ^~~
a.cc:36:44: error: '__gnu_cxx::__alloc_traits<std::allocator<city>, city>::value_type' {aka 'struct city'} has no member named 'size'
   36 |     for (int j = 0, s = (int)prefecture[i].size(); j < s; ++j)
      |                                            ^~~~
a.cc:38:29: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<city>, city>::value_type' {aka 'city'} and 'int')
   38 |       id_upper[prefecture[i][j].in_order] = i;
      |                             ^
a.cc:39:30: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<city>, city>::value_type' {aka 'city'} and 'int')
   39 |       id_bottom[prefecture[i][j].in_order] = j + 1;
      |                              ^
Language: C++

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

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

	vector<vector<pair<int, int>>> d(n+1);
	for (int i = 0; i < m; ++i) {
		int p, y;
		cin >> p >> y;
		d[p].push_back(pair<int,int>(y,i));
	}

	vector<string> ret(m);
	for (int i = 1; i <= n; ++i) {
		sort(d[i].begin(), d[i].end());
		for (int j = 0; j < d[i].size(); ++j) {
			char c1[7];
			sprintf_s(c1, "%06d", i);
			char c2[7];
			sprintf_s(c2, "%06d", j + 1);
			ret[d[i][j].second] = string(c1) + string(c2);
		}
	}

	for (auto& i : ret) {
		cout << i << endl;
	}

	return 0;
}

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

#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>

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

    std::vector<std::pair<long long, long long>> order;
    std::vector<std::unordered_set<long long>> record(n);
    for(int i = 0; i < m; ++i){
        long long p, y;
        std::cin >> p >> y;
        order.push_back(std::make_pair(p, y));
        record.at(p - 1).insert(y);
    }

    for(int i = 0; i < m; ++i){
        std::stringstream ss;
        long long val = order.at(i).first;
        ss << std::setw(6) << std::setfill('0') << val;
        auto start = record.at(val - 1).begin();
        long long dist = std::distance(start, std::find(start, record.at(val - 1).end(), order.at(i).second));
        ss << std::setw(6) << dist + 1;

        std::cout << ss.str() << std::endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: 'unordered_set' is not a member of 'std'
   12 |     std::vector<std::unordered_set<long long>> record(n);
      |                      ^~~~~~~~~~~~~
a.cc:6:1: note: 'std::unordered_set' is defined in header '<unordered_set>'; this is probably fixable by adding '#include <unordered_set>'
    5 | #include <set>
  +++ |+#include <unordered_set>
    6 | 
a.cc:12:45: error: template argument 1 is invalid
   12 |     std::vector<std::unordered_set<long long>> record(n);
      |                                             ^~
a.cc:12:45: error: template argument 2 is invalid
a.cc:17:16: error: request for member 'at' in 'record', which is of non-class type 'int'
   17 |         record.at(p - 1).insert(y);
      |                ^~
a.cc:24:29: error: request for member 'at' in 'record', which is of non-class type 'int'
   24 |         auto start = record.at(val - 1).begin();
      |                             ^~
a.cc:25:71: error: request for member 'at' in 'record', which is of non-class type 'int'
   25 |         long long dist = std::distance(start, std::find(start, record.at(val - 1).end(), order.at(i).second));
      |                                                                       ^~
Language: C++

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

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

using namespace std;

typedef struct City
{
  int y, idx;
  City(){};
  City(int a,int b):y(a), idx(b){}
}City;
int main()
{
  int n, m;
  cin >> n >> m;
  vector<vector<City>> P(n);
  rep(i, m)
  {
    int p, y;
    cin >> p >> y;
    P[p-1].emplace_back(City{y, i});
  }
  vector<pair<int, int>> ans(m);
  rep(i, n)
  {
    sort(P[i].begin(), P[i].end(), [](City l, City r){return l.y < r.y;});
    for(int j = 0; j < P[i].size(); ++j)
    {
      ans[P[i][j].idx] = make_pair(i+1, j+1);
    }
  }
  rep(i, m)
    printf("%06d%06d\n", ans[i].first, ans[i].second);

  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(P[i].begin(), P[i].end(), [](City l, City r){return l.y < r.y;});
      |     ^~~~
      |     short
Language: C++

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

using namespace std;

int main(){
    int N, M;
    cin >> N >> M;
    pair<int, int> G[M];
    map<int, pair<int, int> > m; 

    for(int i=0; i<M; i++){
        cin >> G[i].first >> G[i].second; // pi, yi
        m.insert({i, G[i]});
    }
    map<int, int> odr;
    sort(G, G + M);
    int pre = -1;
    int cnt = 0;

    for(int i=0; i<M; i++){
        if(pre != G[i].first){
            cnt = 0;
            pre = G[i].first;
        }
        cnt ++;
        odr.insert({G[i].second, cnt});
    }


    for(int i=0; i<M; i++){
        cout << setfill('0') << right << setw(6) << m.at(i).first;
        cout << setfill('0') << right << setw(6) << odr.at(m.at(i).second)<< endl;
    }
    return 0;
}

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

#include <iomanip>
#include <iostream>
#include <map>
#include <vector>
#define all(x) (x).begin(), (x).end()
using namespace std;
using P = pair<int, int>;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> City[N + 1];
  int P[M], Y[M];
  for (int i = 0; i < M; i++) {
    int p, y;
    cin >> p >> y;
    City[p].push_back(y);
    P[i] = p, Y[i] = y;
  }

  for (int i = 0; i < N; i++) sort(all(City[P[i]]));

  for (int i = 0; i < M; i++) {
    auto iter = upper_bound(all(City[P[i]]), Y[i]);
    cout << setfill('0') << right << setw(6) << P[i] << setfill('0') << right
         << setw(6) << iter - City[P[i]].begin() << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |   for (int i = 0; i < N; i++) sort(all(City[P[i]]));
      |                               ^~~~
      |                               short
a.cc:24:17: error: 'upper_bound' was not declared in this scope
   24 |     auto iter = upper_bound(all(City[P[i]]), Y[i]);
      |                 ^~~~~~~~~~~
Language: C++

n,m = map(int,input().split())
lst = [[]for i in range(m)]
lst2 = [[]for i in range(n)]
for i in range(m):
  p,y = map(int,input().split())
  lst[i] = [p,y]
  lst2[p-1]+=[y]
for j in range(len(lst2)):
  lst2[j] = sorted(lst2[j])
for k in range(len(lst)):
  x = lst2[lst[k][0]-1].index(lst[k][1])+1
  print("0"*(6-len(str((lst[k][0]))))+str(lst[k][0])+"0"*(6-len(str(x)))+str(x))

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

import java.util.*;
 
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = Integer.parseInt(sc.next());
		int cityNum = Integer.parseInt(sc.next());
		Map<String, List<Integer>> map = new HashMap<String, List<Integer>>();
		String[][] array = new String[cityNum][2];
		for(int i = 0; i < prefectureNum; i++){
			map.put(String.valueOf(i+1), new ArrayList<Integer>());
		}
		for(int i = 0; i < cityNum; i++){
		    array[i][0] = sc.next();
			array[i][1] = sc.next();
			map.get(array[i][0]).add(Integer.parseInt(array[i][1]));
		}
		
		for(String key : map.keySet()){
			Collections.sort(map.get(key));
			for(int i = 0; i < map.get(key).size(); i++){
				for(int j = 0; j < array.length; j++){
			        if(array[j][0].equals(key) && Integer.parseInt(array[j][1]) == (map.get(key).get(i))){
                        StringBuilder sb = new StringBuilder();
                        while(key.length() < 6){
                        	sb.append("0");
                        }
                        sb.append(key);
                        while(map.get(key).get(i).length < 6){
                        	sb.append("0");
                        }
				        array[j][0] = sb.append(map.get(key).get(i)).toString();
				    }
				}
			}
		}
		for(String[] ary2 : array){
		    System.out.println(ary2[0]);
		}
	}
}

Compiler output:
Main.java:29: error: cannot find symbol
                        while(map.get(key).get(i).length < 6){
                                                 ^
  symbol:   variable length
  location: class Integer
1 error
Language: Java

import java.util.*;
 
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = Integer.parseInt(sc.next());
		int cityNum = Integer.parseInt(sc.next());
		Map<String, List<Integer>> map = new HashMap<String, List<Integer>>();
		String[][] array = new String[cityNum][2];
		for(int i = 0; i < prefectureNum; i++){
			map.put(String.valueOf(i+1), new ArrayList<Integer>());
		}
		for(int i = 0; i < cityNum; i++){
		    array[i][0] = sc.next();
			array[i][1] = sc.next();
			map.get(array[i][0]).add(Integer.parseInt(array[i][1]));
		}
		
		for(String key : map.keySet()){
			Collections.sort(map.get(key));
			for(int i = 0; i < map.get(key).size(); i++){
				for(int j = 0; j < array.length; j++){
			        if(array[j][0].equals(key) && Integer.parseInt(array[j][1]) == (map.get(key).get(i))){
                        StringBuilder sb = new StringBuilder();
                        while(key.length() < 6){
                        	sb.append("0");
                        }
                        sb.append(key);
                        while(map.get(key).get(i).length() < 6){
                        	sb.append("0");
                        }
				        array[j][0] = sb.append(map.get(key).get(i)).toString();
				    }
				}
			}
		}
		for(String[] ary2 : array){
		    System.out.println(ary2[0]);
		}
	}
}

Compiler output:
Main.java:29: error: cannot find symbol
                        while(map.get(key).get(i).length() < 6){
                                                 ^
  symbol:   method length()
  location: class Integer
1 error
Language: Java

import java.util.*;
 
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = Integer.parseInt(sc.next());
		int cityNum = Integer.parseInt(sc.next());
		Map<String, List<Integer>> map = new HashMap<String, List<Integer>>();
		String[][] array = new String[cityNum][2];
		for(int i = 0; i < prefectureNum; i++){
			map.put(String.valueOf(i+1), new ArrayList<Integer>());
		}
		for(int i = 0; i < cityNum; i++){
		    array[i][0] = sc.next();
			array[i][1] = sc.next();
			map.get(array[i][0]).add(Integer.parseInt(array[i][1]));
		}
		
		for(String key : map.keySet()){
			Collections.sort(map.get(key));
			for(int i = 0; i < map.get(key).size(); i++){
				for(int j = 0; j < array.length; j++){
			        if(array[j][0].equals(key) && Integer.parseInt(array[j][1]) == (map.get(key).get(i))){
                        StringBuilder sb = new StringBuilder();
                        while(key.length() < 6){
                        	sb.append("0");
                        }
                        sb.append(key);
                        while(map.get(key).get(i).size < 6){
                        	sb.append("0");
                        }
				        array[j][0] = sb.append(map.get(key).get(i)).toString();
				    }
				}
			}
		}
		for(String[] ary2 : array){
		    System.out.println(ary2[0]);
		}
	}
}

Compiler output:
Main.java:29: error: cannot find symbol
                        while(map.get(key).get(i).size < 6){
                                                 ^
  symbol:   variable size
  location: class Integer
1 error
Language: Java

import java.util.*;
 
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = Integer.parseInt(sc.next());
		int cityNum = Integer.parseInt(sc.next());
		Map<String, List<Integer>> map = new HashMap<String, List<Integer>>();
		String[][] array = new String[cityNum][2];
		for(int i = 0; i < prefectureNum; i++){
			map.put(String.valueOf(i+1), new ArrayList<Integer>());
		}
		for(int i = 0; i < cityNum; i++){
		    array[i][0] = sc.next();
			array[i][1] = sc.next();
			map.get(array[i][0]).add(Integer.parseInt(array[i][1]));
		}
		
		for(String key : map.keySet()){
			Collections.sort(map.get(key));
			for(int i = 0; i < map.get(key).size(); i++){
				for(int j = 0; j < array.length; j++){
			        if(array[j][0].equals(key) && Integer.parseInt(array[j][1]) == (map.get(key).get(i))){
                        StringBuilder sb = new StringBuilder();
                        while(key.length() < 6){
                        	sb.append("0");
                        }
                        sb.append(key);
                        while((map.get(key).get(i)).size < 6){
                        	sb.append("0");
                        }
				        array[j][0] = sb.append(map.get(key).get(i)).toString();
				    }
				}
			}
		}
		for(String[] ary2 : array){
		    System.out.println(ary2[0]);
		}
	}
}

Compiler output:
Main.java:29: error: cannot find symbol
                        while((map.get(key).get(i)).size < 6){
                                                   ^
  symbol:   variable size
  location: class Integer
1 error
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = sc.nextInt();
		int cityNum = sc.nextInt();
		Map<String, List<String>> map = new HashMap<String, List<String>>();
		String[][] array = new String[cityNum][2];
		for(int i = 0; i < prefectureNum; i++){
			map.put(String.valueOf(i+1), new ArrayList<String>());
		}
		for(int i = 0; i < cityNum; i++){
		    array[i][0] = sc.next();
			array[i][1] = sc.next();
			map.get(array[i][0]).add(array[i][1]);
		}
		
		for(int i = 0; i < map.get(key).size(); i++){
		    Collections.sort(map.get(key));
			for(int j = 0; j < array.length; j++){
			    if(array[j][0].equals(key)){
			        if(array[j][1].equals(map.get(key).get(i))){
			            array[j][0] = String.format("%06d%06d",Integer.parseInt(key), i + 1);
			        }
			    }
			}
		}
		for(String[] ary2 : array){
		    System.out.println(ary2[0]);
		}
	}
}

Compiler output:
Main.java:19: error: cannot find symbol
		for(int i = 0; i < map.get(key).size(); i++){
		                           ^
  symbol:   variable key
  location: class Main
Main.java:20: error: cannot find symbol
		    Collections.sort(map.get(key));
		                             ^
  symbol:   variable key
  location: class Main
Main.java:22: error: cannot find symbol
			    if(array[j][0].equals(key)){
			                          ^
  symbol:   variable key
  location: class Main
Main.java:23: error: cannot find symbol
			        if(array[j][1].equals(map.get(key).get(i))){
			                                      ^
  symbol:   variable key
  location: class Main
Main.java:24: error: cannot find symbol
			            array[j][0] = String.format("%06d%06d",Integer.parseInt(key), i + 1);
			                                                                    ^
  symbol:   variable key
  location: class Main
5 errors
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = sc.nextInt();
		int cityNum = sc.nextInt();
		Map<String, List<String>> map = new HashMap<String, List<String>>();
		
		for(int i = 0; i < prefectureNum; i++){
			map.put(i+1, new ArrayList<String>());
		}
		
		for(int i = 0; i < cityNum; i++){
			map.get(sc.nextLine()).add(sc.nextLine());
		}
		
		for(String key : map.keySet()){
			Collections.sort(map.get(key));
			for(int i = 0; i < map.get(key).size(); i++){
				String keyAns = key;
				while(keyAns.length() <= 6){
					keyAns = "0" + keyAns;
				}
				String valAns = map.get(key).get(i);
				while(valAns.length() <= 6) {
					valAns = "0" + valAns;
				}
				System.out.println(keyAns + valAns);
			}
		}
	}
}

Compiler output:
Main.java:11: error: incompatible types: int cannot be converted to String
			map.put(i+1, new ArrayList<String>());
			         ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = sc.nextInt();
		int cityNum = sc.nextInt();
		Map<String, List<String>> map = new HashMap<String, List<String>>();
		
		for(int i = 0; i < prefectureNum; i++){
			map.put(i+1, new ArrayList<String>());
		}
		
		for(int i = 0; i < cityNum; i++){
			map.get(sc.nextLine()).add(sc.nextLine());
		}
		
		foreach(String key : map.keySet()){
			Collections.sort(map.get(key));
			for(int i = 0; i < map.get(key).size(); i++){
				String keyAns = key;
				while(keyAns.length() <= 6){
					keyAns = "0" + keyAns;
				}
				String valAns = map.get(key).get(i);
				while(valAns.length() <= 6) {
					valAns = "0" + valAns;
				}
				System.out.println(keyAns + valAns);
			}
		}
	}
}

Compiler output:
Main.java:18: error: ')' or ',' expected
		foreach(String key : map.keySet()){
		              ^
Main.java:18: error: ';' expected
		foreach(String key : map.keySet()){
		                                 ^
2 errors
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = sc.nextInt();
		int cityNum = sc.nextInt();
		Map<String, List<String>> map = new HashMap<String, List<String>>();
		
		for(int i = 0; i < prefectureNum; i++){
			map.put(String.valueOf(i+1), new ArrayList<String>());
		}
		
		for(int i = 0; i < cityNum; i++){
			map.get(sc.nextLine()).add(sc.nextLine());
		}
		
		map.entrySet().stream()
			.sorted(java.util.Map.Entry.comparingByValue());
      
		for(String key : map.keySet()){
			for(int i = 0; i < map.get(key).size(); i++){
				String keyAns = key;
				while(keyAns.length() <= 6){
					keyAns = "0" + keyAns;
				}
				String valAns = map.get(key).get(i);
				while(valAns.length() <= 6) {
					valAns = "0" + valAns;
				}
				System.out.println(keyAns + valAns);
			}
		}
	}
}

Compiler output:
Main.java:19: error: incompatible types: inference variable V has incompatible bounds
			.sorted(java.util.Map.Entry.comparingByValue());
			^
    equality constraints: List<String>
    upper bounds: Comparable<? super V>
  where V,K are type-variables:
    V extends Comparable<? super V> declared in method <K,V>comparingByValue()
    K extends Object declared in method <K,V>comparingByValue()
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = sc.nextInt();
		int cityNum = sc.nextInt();
		Map<String, List<String>> map = new HashMap<String, List<String>>();
		
		for(int i = 0; i < prefectureNum; i++){
			map.put(i+1, new ArrayList<String>());
		}
		
		for(int i = 0; i < cityNum; i++){
			map.get(sc.nextLine()).add(sc.nextLine());
		}
		
		map.entrySet().stream()
			.sorted(Map.Entry.comparingByValue());
		for(String key : map.keySet()){
			for(int i = 0; i < map.get(key).size(); i++){
				String keyAns = key;
				while(keyAns.length() <= 6){
					keyAns = "0" + keyAns;
				}
				String valAns = map.get(key).get(i);
				while(valAns.length() <= 6) {
					valAns = "0" + valAns;
				}
				System.out.println(keyAns + valAns);
			}
		}
	}
}

Compiler output:
Main.java:11: error: incompatible types: int cannot be converted to String
			map.put(i+1, new ArrayList<String>());
			         ^
Main.java:19: error: incompatible types: inference variable V has incompatible bounds
			.sorted(Map.Entry.comparingByValue());
			^
    equality constraints: List<String>
    upper bounds: Comparable<? super V>
  where V,K are type-variables:
    V extends Comparable<? super V> declared in method <K,V>comparingByValue()
    K extends Object declared in method <K,V>comparingByValue()
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = sc.nextInt();
		int cityNum = sc.nextInt();
		Map<String, List<String>> map = new HashMap<String, List<String>>();
		
		for(int i = 0; i < prefectureNum; i++){
			map.put(i+1, new ArrayList<String>());
		}
		
		for(int i = 0; i < cityNum; i++){
			map.get(sc.nextLine()).add(sc.nextLine());
		}
		
		map.entrySet().stream()
			.sorted(Map.Entry.comparingByValue());
		foreach(String key : map.keySet()){
			for(int i = 0; i < map.get(key).size(); i++){
				String keyAns = key;
				while(keyAns.length() <= 6){
					keyAns = "0" + keyAns;
				}
				String valAns = map.get(key).get(i);
				while(valAns.length() <= 6) {
					valAns = "0" + valAns;
				}
				System.out.println(keyAns + valAns);
			}
		}
	}
}

Compiler output:
Main.java:20: error: ')' or ',' expected
		foreach(String key : map.keySet()){
		              ^
Main.java:20: error: ';' expected
		foreach(String key : map.keySet()){
		                                 ^
2 errors
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int prefectureNum = sc.nextInt();
		int cityNum = sc.nextInt();
		Map<String, List<String>> map = new HashMap<String, List<String>>():
		
		for(int i = 0; i < prefectureNum; i++){
			map.put(i+1, new ArrayList<String>());
		}
		
		for(int i = 0; i < cityNum; i++){
			map.get(sc.nextLine()).add(sc.nextLine());
		}
		
		map.entrySet().stream()
			.sorted(Map.Entry.comparingByValue());
		foreach(String key : map.KeySet()){
			for(int i = 0; i < map.get(key).size(); i++){
				String keyAns = key;
				while(keyAns.length() <= 6){
					keyAns = "0" + keyAns;
				}
				String valAns = map.get(key).get(i);
				while(valAns.length() <= 6) {
					valAns = "0" + valAns;
				}
				System.out.println(keyAns + valAns);
			}
		}
	}
}

Compiler output:
Main.java:8: error: ';' expected
		Map<String, List<String>> map = new HashMap<String, List<String>>():
		                                                                   ^
Main.java:20: error: ')' or ',' expected
		foreach(String key : map.KeySet()){
		              ^
Main.java:20: error: ';' expected
		foreach(String key : map.KeySet()){
		                                 ^
3 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:20: warning: extra tokens at end of #include directive
    1 | #include <cstdio > #include <vector > #include <algorithm > using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<n;i++)
      |                    ^
a.cc:1:10: fatal error: cstdio : No such file or directory
    1 | #include <cstdio > #include <vector > #include <algorithm > using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<n;i++)
      |          ^~~~~~~~~
compilation terminated.
Language: Java

pimport java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;


public class Main{
	  public static void main(String[] args){
	    Scanner sc = new Scanner(System.in);
	 
	    int n = sc.nextInt(); //県の数
	    int m = sc.nextInt(); //市の数
	    Map<Integer,int[]> map = new TreeMap<Integer,int[]>();
	 
	    for(int i=0; i<m; i++){
	        int[] array = new int[2];
	        array[0] = i;
	        array[1] = sc.nextInt(); //県番号
	        int b = sc.nextInt(); //誕生年
	        map.put(b,array);
	    }
	    int[] ary = new int[n]; //県の数を格納
	    String[] s = new String[m]; //IDを格納
	 
	    for(int[] num :map.values()){
	      ary[num[1]-1]++;
	      s[num[0]] = String.format("%06d%06d",num[1],ary[num[1]-1]);
	    }
	    
	/*    for(String a: s) {
	    	System.out.println(a);
	 	  }*/
	    
	    StringBuilder sb = new StringBuilder();
	    for(String ss:s) {
	    	sb.append(ss+"\n");
	    }
	    System.out.println(sb);
	    
	  }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
pimport java.util.Map;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Scanner;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.TreeMap;
^
3 errors
Language: C++

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

int main(){
  int n,m;cin >> n >> m;
  vector<pair<int,int>> y_p;
  vector<pair<int,int>> p_y;
  int y,p;
  for(int i=0; i<m; i++){
    cin >> p >> y;
    p_y_s.push_back(make_pair(p,y));
    p_y.push_back(make_pair(p,y));
  }
  sort(p_y_s.begin(),p_y_s.end());
  map<pair<int,int>,int> mp_py_id;
  
  int count=0;
  int pre_p=0;
  int np,ny;
  for(int i=0; i<m; i++){
    np = p_y_s.at(i).first;ny = p_y_s.at(i).second;
    if(np!=pre_p)count = 1;
    else count++;
    mp_py_id[make_pair(np,ny)] = count;
    pre_p = np;
  }
  
  for(int i=0; i<m; i++){
    cout << setfill('0') << right << setw(6) << p_y.at(i).first;
    cout << setfill('0') << right << setw(6) << mp_py_id[p_y.at(i)] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'p_y_s' was not declared in this scope; did you mean 'p_y'?
   11 |     p_y_s.push_back(make_pair(p,y));
      |     ^~~~~
      |     p_y
a.cc:14:8: error: 'p_y_s' was not declared in this scope; did you mean 'p_y'?
   14 |   sort(p_y_s.begin(),p_y_s.end());
      |        ^~~~~
      |        p_y
Language: C++

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

Compiler output:
a.cc:1:22: warning: extra tokens at end of #include directive
    1 | # 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); }
      |                      ^
a.cc:1:11: fatal error:  cstdio : No such file or directory
    1 | # 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); }
      |           ^~~~~~~~~~
compilation terminated.
Language: C++

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

bool cmp(pair<pair<int,int>,int> a,pair<pair<int,int>,int> b){
  return a.second < b.second;
}

int digit(int n){
  int i=0;
  while(n!=0){
    n/=10;
    i++;
  }
  return i;
}

int main(){
  int i,j,cnt=0;
  int n,m;
  cin>>n>>m;
  int p[m],y[m];
  for(i=0;i<m;i++)cin>>p[i]>>y[i];
  vector<pair<pair<int,int>,int>> v;
  for(i=0;i<m;i++){
    v.push_back(pair<pair<int,int>,int>(pair<int,int>(p[i],y[i]),i));
  }
  sort(v.begin(),v.end());
  v[0].first.second=1;
  cnt=2;
  for(i=1;i<m;i++){
    if(v[i].first.first!=v[i-1].first.first)cnt=1;
    v[i].first.second=cnt++;
  }
  sort(v.begin(),v.end(),cmp);
  for(i=0;i<m;i++){
    for(j=0;j<6-digit(v[i].first.first);j++){
      cout<<0;
    }
    cout<<v[i].first.first;
    for(j=0;j<6-digit(v[i].first.secont);j++){
      cout<<0;
    }
    cout<<v[i].first.second<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:34: error: 'struct std::pair<int, int>' has no member named 'secont'; did you mean 'second'?
   41 |     for(j=0;j<6-digit(v[i].first.secont);j++){
      |                                  ^~~~~~
      |                                  second