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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
    private static Scanner sc;
    public static void main(String[] args) {
    	Main instance = new Main();
    	sc = instance.new Scanner();
    	instance.solve();
    }
    int N;
    int M;

    private void solve() {
    	try {
    		N = sc.nextInt();
    		M = sc.nextInt();
    		List<List<Integer>> list = new ArrayList<>();
    		String[] sa = new String[M];
    		for (int i = 0; i < M; i++) {
    			List<Integer> tmp = new ArrayList<>();
    			tmp.add(sc.nextInt());
    			tmp.add(sc.nextInt());
    			tmp.add(i);
    			list.add(tmp);
    		}
    		list.sort((a,b) -> {
    			if (b.get(0) > a.get(0)) {
                    return -1;
                }
                else if (b.get(0) < a.get(0)) {
                    return 1;
                }
                else {
                    if (b.get(1) > a.get(1)){
                        return -1;
                    } else {
                        return 1;
                    }
                }
    		});
    		int temp = 0;
    		int count = 1;
    		for (int i = 0; i < M; i++) {
    			int zero = list.get(i).get(0);
    			if (temp != zero) {
    				temp = zero;
    				count = 1;
    			}
    			sa[list.get(i).get(2)] = String.format("%06d%06d", zero, count);
    			count++;
    		}
    		for (int i = 0; i < M; i++) {
    			System.out.println(sa[i]);
    		}
    	} catch (Exception e) {
    		e.printStackTrace();
    	}
    }


    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null) br.close();
        }

        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String st = br.readLine();
            while (st == "") st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }

}
fjadlfjalf


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

def set_format(name: int):
    """6桁に揃える"""
    formated_name = "{:0=6}".format(name)
    return formated_name

def main():
    N, M = [int(c) for c in input().split()]
    lists = []
    for i in range(M):
        city = i
        prefecture, year = [int(c) for c in input().split()]
        id_ = ""
        lists.append([city, prefecture, year, id_])

    prefectures = [0] * (N + 1)

    #年のソート
    lists.sort(key=lambda x: x[2])

    for i in range(M):
        # 県名
        prefecture_name = lists[i][1]
        lists[i][3] = set_format(prefecture_name) + set_format(prefectures[prefecture_name] + 1)
        prefectures[prefecture_name] += 1

    lists.sort(key=lambda x: x[0])

    for i in range(M):
        print(lists[i][3])

if __name__ =='__main__':
    main()

Compiler output:
a.cc:17:6: error: invalid preprocessing directive #\U00005e74\U0000306e\U000030bd\U000030fc\U000030c8
   17 |     #年のソート
      |      ^~~~~~~~~~
a.cc:21:11: error: invalid preprocessing directive #\U0000770c\U0000540d
   21 |         # 県名
      |           ^~~~
a.cc:31:15: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   31 | if __name__ =='__main__':
      |               ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def set_format(name: int):
      | ^~~
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  vector<pair<ll,ll>> vec(M,pair<ll,ll>());
  vector<vector<ll>> vec2(N,vector<ll>(M));
  for(int i=0;i<M;i++)
    cin>>vec.at(i).second>>vec.at(i).first;
  
  sort(vec.begin(),vec.end());
  for(int i=0;i<M;i++)
    swap(vec.at(i).first,vec.at(i).second);
  
  sort(vec.begin(),vec.end());
  
  for(pair<ll,ll> a:vec)
    cout<<a.first<<" "<<a.second<<endl;
  for(int i=0;i<N;i++){
    while(
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
a.cc:22:11: error: expected ')' before '}' token
   22 |     while(
      |          ~^
      |           )
   23 | 
   24 | }
      | ~          
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

using namespace std;
typedef long long ll;
const int MAXN = 1e5+10;
const int MAXM = 1e5+10;

ll n, m;
ll p[MAXM], y[MAXM];
vector<ll> prefs[MAXN];

void solve() {
  for (int i=0;i<m;i++) {
    prefs[p[i]].push_back(y[i]);
  }
  for (int i=0;i<n;i++) {
    sort(prefs[i].begin(), prefs[i].end());
  }
  for (int i=0;i<m;i++) {
    ll pos = find(prefs[p[i]].begin(), prefs[p[i]].end(), y[i]) - prefs[p[i]].begin() + 1;
    printf("%06lld%06lld\n", p[i], pos);
  }
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |     sort(prefs[i].begin(), prefs[i].end());
      |     ^~~~
      |     short
a.cc:22:18: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, ll&)'
   22 |     ll pos = find(prefs[p[i]].begin(), prefs[p[i]].end(), y[i]) - prefs[p[i]].begin() + 1;
      |              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:22:18: note:   '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   22 |     ll pos = find(prefs[p[i]].begin(), prefs[p[i]].end(), y[i]) - prefs[p[i]].begin() + 1;
      |              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:34: error: 'std::map<int, std::vector<int> >::mapped_type' {aka 'class std::vector<int>'} has no member named 'second'
   10 |   for(int i=0;i<n;i++)sort(mp[i].second.begin(),mp[i].second.end());
      |                                  ^~~~~~
a.cc:10:55: error: 'std::map<int, std::vector<int> >::mapped_type' {aka 'class std::vector<int>'} has no member named 'second'
   10 |   for(int i=0;i<n;i++)sort(mp[i].second.begin(),mp[i].second.end());
      |                                                       ^~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
    5 |   int n.m;cin >>n>>m;
      |        ^
a.cc:5:17: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   int n.m;cin >>n>>m;
      |                 ^
      |                 yn
a.cc:5:20: error: 'm' was not declared in this scope; did you mean 'tm'?
    5 |   int n.m;cin >>n>>m;
      |                    ^
      |                    tm
a.cc:8:6: error: missing template arguments before '(' token
    8 |   map(int,vector<int>)mp(n);
      |      ^
a.cc:8:7: error: expected primary-expression before 'int'
    8 |   map(int,vector<int>)mp(n);
      |       ^~~
a.cc:8:22: error: expected primary-expression before ')' token
    8 |   map(int,vector<int>)mp(n);
      |                      ^
a.cc:9:23: error: 'mp' was not declared in this scope; did you mean 'p'?
    9 |   for(int i=0;i<m;i++)mp[p[i]].push_back(y[i]);
      |                       ^~
      |                       p
a.cc:10:28: error: 'mp' was not declared in this scope; did you mean 'p'?
   10 |   for(int i=0;i<n;i++)sort(mp[i].begin(),mp[i].end());
      |                            ^~
      |                            p
a.cc:12:15: error: 'mp' was not declared in this scope; did you mean 'p'?
   12 |    int k=find(mp[p[i]].begin(),mp[p[i]].end())-mp[p[i]].begin();
      |               ^~
      |               p
Language: C

#include <stdio.h>
#include <stdlib.h>
typedef struct{
	int	P;
	int	Y;
	int	NUM;
	char ID[13];
}City;

int cmp_Y( const void *p, const void *q ) {
    return ((City*)p)->Y - ((City*)q)->Y;
}
int cmp_NUM( const void *p, const void *q ) {
    return ((City*)p)->NUM - ((City*)q)->NUM;
}

int main(void){
	int N,M;
	int i,j;
	int Numberofoccurrences[100001]={};
	scanf("%d %d",&N,&M);
	City city[M];
	for(i=0;i<M;i++){
		scanf("%d %d",&city[i].P,&city[i].Y);
		city[i].NUM=i+1;
	}
	int n = sizeof city / sizeof( City );
	qsort( city, n, sizeof(City), cmp_Y );
	for(i=0;i<M;i++){
		printf("%d %d %d\n",city[i].P,city[i].Y,city[i].NUM);
	}
	/*
	Y[i]についてソートして識別番号を作ったのちに
	NUM[i]についてソートして元の順番に戻せばOK
	*/
	for(i=0;i<M;i++){
		Numberofoccurrences[city[i].P]++;
		city.ID = ("%06d",city.P[i]) ("%06d",Numberofoccurrences[city[i].P]);	
	}
	qsort( city, n, sizeof(City), cmp_NUM );
	
	for(i=0;i<M;i++){
		printf("%s",city.ID[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:38:21: error: '(City *)&city' is a pointer; did you mean to use '->'?
   38 |                 city.ID = ("%06d",city.P[i]) ("%06d",Numberofoccurrences[city[i].P]);
      |                     ^
      |                     ->
main.c:38:39: error: '(City *)&city' is a pointer; did you mean to use '->'?
   38 |                 city.ID = ("%06d",city.P[i]) ("%06d",Numberofoccurrences[city[i].P]);
      |                                       ^
      |                                       ->
main.c:43:33: error: '(City *)&city' is a pointer; did you mean to use '->'?
   43 |                 printf("%s",city.ID[i]);
      |                                 ^
      |                                 ->
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < n; i++)
/*
struct city{
    int P;
    ll Y;
    int x;
}
*/

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);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |     rep(i, N) sort(yd[i+1].begin(), yd[i+1].end());
      |               ^~~~
      |               short
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();
		HashMap<Integer, Integer[]> map = new HashMap<>();
		int[][] data = new int[m][4];
		for(int i = 0; i < m; i++) {
			data[i][0] = i;
			data[i][1] = sc.nextInt();
			data[i][2] = sc.nextInt();
			data[i][3] = 1;
		}
		Arrays.sort(data, (x,y) -> x[1] == y[1] ? x[2]-y[2] : x[1] - y[1]);
		for(int i = 1; i < m; i++) {
			if(data[i][1] == data[i-1][1])
				data[i][3] = data[i-1][3] + 1;
		}
		Arrays.sort(data, (x,y) -> x[0] - y[0]);
		for(int i = 0; i < m; i++) {
			System.out.printf("%06d%06d", data[i][1], data[i][3]);
			System.out.println();
		}
	}

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

#include "stdafx.h"

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <random>

using namespace std;

class Puzzle {
public:
	int N, M;
	vector<int> Ps;
	vector<int> Ys;
	map<int, vector<int> > kens;

	void Input() 
	{
		cin >> N >> M;
		int p, y;
		for (int pi = 0; pi < M; pi++) {
			cin >> p >> y;
			Ps.push_back(p);
			Ys.push_back(y);
		}
	}

	void Play() 
	{
		for (int pi = 0; pi < M; pi++) {
			kens[Ps[pi]].push_back(Ys[pi]);
		}

		for (auto itr = kens.begin(); itr != kens.end(); itr++) {
			sort(itr->second.begin(), itr->second.end());
		}

		for (int pi = 0; pi < M; pi++) {
			int no = GetRank(kens[Ps[pi]], Ys[pi]);
			printf("%06d%06d\n", Ps[pi], no);
		}
		//cout << "debug\n";
	}

	int GetRank(vector<int>list, int target)
	{
		//sort(list.begin(), list.end());
		int index = find(list.begin(), list.end(), target) - list.begin();
		return index + 1;
	}
};


int main()
{
	Puzzle puz;

	puz.Input();
	puz.Play();

	return 0;
}



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

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
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; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<60;
 
int main() {
	ll n, m;
  	cin >> n >> m;
  	vector<tuple<ll, ll, ll>> data(m);
  rep(i,n){
    	ll p;
    	ll y;
    	cin >> p;
    	cin >> y;
    	data[i] = make_tuple(y, p, i);
  	}
 	sort(data.begin(), data.end());
	vector<ll> cnt(N + 1);
  
  	pair<ll, ll> id[m];
  	rep(i,m){
      ll y, p, idx;
      tie(y, p, idx) = data[i];
      ++cnt[p];
      id[idx] = make_pair(p, cnt[p]);
    }
  
  	rep(i,m){
      cout << setw(6) << setfill('0') << id[i].first;
      cout << setw(6) << setfill('0') << id[i].second << endl;
  	}
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:24: error: 'N' was not declared in this scope
   33 |         vector<ll> cnt(N + 1);
      |                        ^
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
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; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<60;
 
int main() {
	ll n, m;
  	cin >> n >> m;
  	tuple<ll, ll, ll> data[m];
  rep(i,n){
    	int p;
    	int y;
    	cin >> p;
    	cin >> y;
    	data[i] = make_tuple(y, p, i);
  	}
 	sort(data.begin(), data.end());
  	int cnt[n + 1];
  	fill(cnt, cnt + n + 1, 0);
  
  	pair<ll, ll> id[m];
  	rep(i,m){
      int y, p, idx;
      tie(y, p, idx) = data[i];
      ++cnt[p];
      id[idx] = make_pair(p, cnt[p]);
    }
  	rep(i,m){
      cout << setw(6) << setfill('0') << id[i].first;
      cout << setw(6) << setfill('0') << id[i].second << endl;
  	}
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: request for member 'begin' in 'data', which is of non-class type 'std::tuple<long long int, long long int, long long int> [m]'
   32 |         sort(data.begin(), data.end());
      |                   ^~~~~
a.cc:32:33: error: request for member 'end' in 'data', which is of non-class type 'std::tuple<long long int, long long int, long long int> [m]'
   32 |         sort(data.begin(), data.end());
      |                                 ^~~
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
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; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<60;
 
int main() {
	ll n, m;
  	cin >> n >> m;
  	vector<pair<ll, ll> > pairs(m);
  rep(i,n){
    	ll p;
    	ll y;
    	cin >> p;
    	cin >> y;
    	pairs[i] = make_pair(p, y);
  	}
 	sort(pairs.begin(), pairs.end());
  	rep(i,n){
      printf("%06d%06d\n", pairs[i].first, lower_bound(all(pairs.second), pairs[i].second) + 1);
    }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:66: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'second'
   34 |       printf("%06d%06d\n", pairs[i].first, lower_bound(all(pairs.second), pairs[i].second) + 1);
      |                                                                  ^~~~~~
a.cc:2:17: note: in definition of macro 'all'
    2 | #define all(x) (x).begin(),(x).end()
      |                 ^
a.cc:34:66: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'second'
   34 |       printf("%06d%06d\n", pairs[i].first, lower_bound(all(pairs.second), pairs[i].second) + 1);
      |                                                                  ^~~~~~
a.cc:2:29: note: in definition of macro 'all'
    2 | #define all(x) (x).begin(),(x).end()
      |                             ^
Language: Java

import java.util.Arrays;
import java.util.Comparator;
import java.util.stream.Collectors;

public class AtCoder {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        int n = scanner.nextInt(), m = scanner.nextInt();
        City[] cities = new City[m];
        for (int i = 0; i < m; i++)
            cities[i] = new City(scanner.nextInt(), scanner.nextInt());
        Arrays.stream(cities)
                .collect(Collectors.groupingBy(city -> city.p))
                .values().forEach(cityList -> {
                    cityList.sort(Comparator.comparingInt(city -> city.y));
                    for (int i = 0; i < cityList.size();)
                        cityList.get(i).o = ++i;
                });
        for (City city : cities)
            System.out.println(String.format("%06d%06d", city.p, city.o));
    }

    static class City {
        int p, y, o;

        City(int p, int y) {
            this.p = p;
            this.y = y;
        }
    }
}

Compiler output:
Main.java:5: error: class AtCoder is public, should be declared in a file named AtCoder.java
public class AtCoder {
       ^
1 error
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; 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: C++

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


int main(){
	int N, M;
	cin >> N >> M;
	vector<int> p(M), y(M), s(M);
	vector<vector<pair<int, int>>> v(N+1);
	fot(int i = 0;i<M;i++){
		cin >> p[i] >> y[i];
		v[p[i]].push_back(y[i], i);
	}
	for(int i = 1;i<=N;i++){
		sort(v[i].begin(), v[i].end());
		for(j=0;j<(int)v[i].size();j++){
			s[v[i][j].second] = j + 1;
		}
	}
	for(int i=0;i<M;i++){
		printf("%06d%06d\n", p[i], s[i]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before 'int'
   12 |         fot(int i = 0;i<M;i++){
      |             ^~~
a.cc:12:23: error: 'i' was not declared in this scope
   12 |         fot(int i = 0;i<M;i++){
      |                       ^
a.cc:17:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   17 |                 sort(v[i].begin(), v[i].end());
      |                 ^~~~
      |                 sqrt
a.cc:18:21: error: 'j' was not declared in this scope
   18 |                 for(j=0;j<(int)v[i].size();j++){
      |                     ^
Language: Java

import java.io.IOException;
import java.io.InputStream;
import java.util.*;

class FastScanner {
  private final InputStream in = System.in;
  private final byte[] buffer = new byte[1024];
  private int ptr = 0;
  private int buflen = 0;
  private boolean hasNextByte() {
    if (ptr < buflen) {
      return true;
    }else{
      ptr = 0;
      try {
        buflen = in.read(buffer);
      } catch (IOException e) {
        e.printStackTrace();
      }
      if (buflen <= 0) {
        return false;
      }
    }
    return true;
  }
  private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
  private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
  private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
  public boolean hasNext() { skipUnprintable(); return hasNextByte();}
  public String next() {
    if (!hasNext()) throw new NoSuchElementException();
    StringBuilder sb = new StringBuilder();
    int b = readByte();
    while(isPrintableChar(b)) {
      sb.appendCodePoint(b);
      b = readByte();
    }
    return sb.toString();
  }
  public long nextLong() {
    if (!hasNext()) throw new NoSuchElementException();
    long n = 0;
    boolean minus = false;
    int b = readByte();
    if (b == '-') {
      minus = true;
      b = readByte();
    }
    if (b < '0' || '9' < b) {
      throw new NumberFormatException();
    }
    while(true){
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      }else if(b == -1 || !isPrintableChar(b)){
        return minus ? -n : n;
      }else{
        throw new NumberFormatException();
      }
      b = readByte();
    }
  }
  public int nextInt() {
    return (int)nextLong();
  }
}

import java.util.*;

public class Main {

  static FastScanner sc = new FastScanner();

  public static void main(String[] args) {

    int N = sc.nextInt();
    int M = sc.nextInt();

    ArrayList<City> cities = new ArrayList();
    for (int i=0; i<M; i++) {
      cities.add(new City(i, sc.nextInt(), sc.nextInt()));
    }

    cities.sort((x, y) -> {
      if (x.p == y.p) {
        return x.y - y.y;
      } else {
        return x.p - y.p;
      }
    });

    String[] ids = new String[M];

    int count = 0;
    for (int i=0; i<M; i++) {
      City c = cities.get(i);
      if (i == 0 || c.p != cities.get(i-1).p) count = 0;
      else count++;
      ids[c.i] = padding0(c.p, 6) + padding0(count+1, 6);
    }

    for (int i=0; i<M; i++) {
      System.out.println(ids[i]);
    }

  }

  static String padding0(int n, int m) {
    String s = Integer.toString(n);
    while (m - s.length() > 0) s = "0" + s;
    return s;
  }


  static class City {
    int i, p, y;
    City (int i, int p, int y) {
      this.i = i;
      this.p = p;
      this.y = y;
    }
  }

}


Compiler output:
Main.java:69: error: class, interface, enum, or record expected
import java.util.*;
^
1 error
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int N;
    cin>>N;
    vector<double> v(N);
    long T,A;
    cin>>T>>A;

    for(int i=0;i<N;++i){
        cin>>v[i];
        v[i]=fabs(A-(T-v[i]*0.006));
    }
    long ans=0;
    for(int i=1;i<N;++i){
        if(v[ans]>v[i]){
            ans=i;
        }
    }

    cout<<ans+1<<endl;
}



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

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
string sixdigits(int n){
    string ret = to_string(n);
    int digits = ret.length();
    for(size_t i = 0; i < 6 - digits; i++)
    {
        ret = "0" + ret;
    }
    return ret;
}
int main(){
    int N, M;
    cin >> N >> M;
    vector<int> P(M, 0);
    vector<int> Y(M, 0);
    vector<vector<int> > Pref(N);
    for(size_t i = 0; i < M; i++)
    {
        cin >> P[i] >> Y[i];
        Pref[P[i]-1].push_back(Y[i]);
    }
    for( auto& vec : Pref){
        if (!vec.empty())
            sort(vec.begin(), vec.end());
    }
    for(size_t i = 0; i < M; i++)
    {
        string ret = sixdigits(P[i]);
        int order = 1 + distance(Pref[P[i]-1].begin(), upper_boud(Pref[P[i]-1].begin(), Pref[P[i]-1].end(), Y[i]));
        ret += sixdigits(order);
        cout << ret << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:56: error: 'upper_boud' was not declared in this scope
   33 |         int order = 1 + distance(Pref[P[i]-1].begin(), upper_boud(Pref[P[i]-1].begin(), Pref[P[i]-1].end(), Y[i]));
      |                                                        ^~~~~~~~~~
Language: C++

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

int main(){

    int N,M;
    cin >> N >> M;
    vector<pair<int,int>> city[M];

    for(int i=0; i<M; i++){
        int name_tmp, year_tmp;
        cin >> name_tmp >> year_tmp;
        city[name_tmp-1].push_back({year_tmp,i});
    }

    char ans[M][13];

    for(int i=0;i<N;i++){
        sort(city[i].begin(), city[i].end());
 
        for(int j=0;j<city[i].size();j++){
            sprintf(ans[city[i][j].second], "%06d%06d", i+1, j+1);
        }
    }

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

    return 0;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: 'm' was not declared in this scope
   28 |     for(int i=0;i<m;i++){
      |                   ^
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import 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, ArrayList<Integer>> map = new TreeMap<Integer, ArrayList<Integer>>();

		for (int i = 0; i < M; i++) {
			int P = sc.nextInt();
			int Y = sc.nextInt();
			map.put(Y, new ArrayList<Integer>(Arrays.asList(P,i)));
		}
		String ans[] = new String[M];
		int cnt[] = new int[N+1];
		for (List<Integer> list : map.values()) {
			ans[list.get(1)] = String.format("%06d%06d", list.get(0), ++cnt[list.get(0)]);
		}
		for (int i = 0; i < M; i++) {
			System.out.println(ans[i]);
		}
	}
}


Compiler output:
Main.java:15: error: illegal character: '\u3000'
      ?Map<Integer, ArrayList<Integer>> map = new TreeMap<Integer, ArrayList<Integer>>();
      ^
1 error
Language: C++

N, M = map(int,input().split())

class ID:
    def __init__(self,p,y,i):
        self.p = p
        self.y = y
        self.i = i
        self.ID1 = None
        self.ID2 = None

    def ID(self):
        for i in range(1,7):
            if self.ID1 < 10**i:
                self.ID1 = "0"*(6-i) + str(self.ID1)
                break
        for i in range(1,7):
            if int(self.ID2) < 10**i:
                self.ID2 = "0"*(6-i) + str(self.ID2)
                break
        
        return self.ID1 + self.ID2

cities = []
for i in range(0,M):
    P,Y = map(int,input().split())
    cities.append(ID(P,Y,i))
cities.sort(key = lambda x: x.y)
counter = [-1]

for i in range(0,N):
    counter.append(1)

for c in cities:
    c.ID1 = c.p
    c.ID2 = counter[c.p]
    counter[c.p] = counter[c.p] + 1

cities.sort(key = lambda x: x.i)

for i in range(0,M):
    print(cities[i].ID())


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

#include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>

#define loop(i, times) for(int i = 0; i < times; i++)
#define seloop(i, start_index, end_index) for(int i = start_index; i < end_index; i++)
#define eqseloop(i, start_index, end_index) for(int i = start_index; i <= end_index; i++)

using namespace std;

struct Town
{
	int prefectures_;	// 都道府県
	long time_;			// 街生成時間
	string id_;			// 認識番号
};

int main()
{
	int n;  cin >> n;
	int m;	cin >> m;
	vector<Town> town_collection;
	town_collection.resize(m + 1);

	// 街のデータ入力
	loop(i, m)
		cin >> town_collection[i].prefectures_ >> town_collection[i].time_;

	// 街が出来た時間でソートするためのコンテナを作る
	vector<vector<pair<int, Town*>>> time_collection;
	time_collection.resize(n + 1);
	loop(i, m)
		time_collection[town_collection[i].prefectures_].push_back(std::make_pair(town_collection[i].time_, &town_collection[i]));

	string p;
	string x;
	for (int prefecture_index = 1; prefecture_index < n + 1; prefecture_index++)
	{	// 街が出来た時間でソートして認識番号を作る
		sort(time_collection[prefecture_index].begin(), time_collection[prefecture_index].end());

		int time_index = 1;
		for (const auto& e : time_collection[prefecture_index])
		{
			p.resize(6, '0');
			p.replace(6 - to_string(prefecture_index).size(), to_string(prefecture_index).size(), to_string(i));
			x.resize(6, '0');
			x.replace(6 - to_string(time_index).size(), to_string(time_index).size(), to_string(time_index));
			e.second->id_ = p + x;
			p.clear();
			x.clear();
			time_index++;
		}
	}

	// 結果出力
	for (const auto& e : town_collection)
		cout << e.id_ << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:121: error: 'i' was not declared in this scope
   47 |                         p.replace(6 - to_string(prefecture_index).size(), to_string(prefecture_index).size(), to_string(i));
      |                                                                                                                         ^
Language: C++

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

int main(){
  int n , m;
  cin >> n >> m;
  vector<int>pre(m);
  vector<int>year(n);
  for(int i = 0; i < m; i++){
    cin >> pre.at(i) >> year.at(i);
  }
  vector<vector>order(n);
  for (int i = 0; i < m ; i++){
    order.at(pre.at(i)-1).push_back(i);
  a
  vector<vector>sorder(n);
  for (int j = 0; j < n; j++){
    sorder.at(j) = order.at(j);
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   12 |   vector<vector>order(n);
      |                ^
a.cc:12:16: note:   expected a type, got 'vector'
a.cc:12:16: error: template argument 2 is invalid
a.cc:14:11: error: request for member 'at' in 'order', which is of non-class type 'int'
   14 |     order.at(pre.at(i)-1).push_back(i);
      |           ^~
a.cc:15:3: error: 'a' was not declared in this scope
   15 |   a
      |   ^
a.cc:18:5: error: 'sorder' was not declared in this scope; did you mean 'order'?
   18 |     sorder.at(j) = order.at(j);
      |     ^~~~~~
      |     order
a.cc:18:26: error: request for member 'at' in 'order', which is of non-class type 'int'
   18 |     sorder.at(j) = order.at(j);
      |                          ^~
a.cc:18:32: error: expected '}' at end of input
   18 |     sorder.at(j) = order.at(j);
      |                                ^
a.cc:17:30: note: to match this '{'
   17 |   for (int j = 0; j < n; j++){
      |                              ^
a.cc:18:32: error: expected '}' at end of input
   18 |     sorder.at(j) = order.at(j);
      |                                ^
a.cc:13:31: note: to match this '{'
   13 |   for (int i = 0; i < m ; i++){
      |                               ^
a.cc:18:32: error: expected '}' at end of input
   18 |     sorder.at(j) = order.at(j);
      |                                ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int n, m;
    cin >> n >> m;
    int p[m], y[m];
    static int py[100001][100000];
    static int len[100001];

    for (int i = 0; i < m; i++) cin >> p[i] >> y[i];
    for (int i = 0; i < m; i++) py[p[i]][len[p[i]]++] = y[i];
    for (int i = 0; i < n; i++) sort(py[i + 1], py[i + 1] + len[i + 1]);
    for (int i = 0; i < m; i++) {
        printf("%06d%06d\n", p[i],
               lower_bound(py[p[i]], py[p[i]] + len[p[i]], y[i]) - py[p[i]] +
                   1);
    }
}


Compiler output:
/tmp/ccPXgzOR.o: in function `main':
a.cc:(.text+0x168): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x180): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x1ef): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x28b): relocation truncated to fit: R_X86_64_PC32 against `.bss'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;typedef long long ll;int main(){int n,m;cin>>n>>m;int p[m],y[m];static int py[100001][100000];static int len[100001];for(int i=0;i<=n;i++)len[i]=0;for(int i=0;i<m;i++)cin>>p[i]>>y[i];for(int i=0;i<m;i++)py[p[i]][len[p[i]]++]=y[i];for(int i=0;i<n;i++)sort(py[i+1],py[i+1]+len[i+1]);for(int i=0;i<m;i++){printf("%06d%06d\n",p[i],lower_bound(py[p[i]],py[p[i]]+len[p[i]],y[i])-py[p[i]]+1);}}


Compiler output:
/tmp/cc1r24UU.o: in function `main':
a.cc:(.text+0xe6): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x198): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x1b0): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x2bb): relocation truncated to fit: R_X86_64_PC32 against `.bss'
collect2: error: ld returned 1 exit status
Language: C++

#include <algorithm>
#include <cstdio>

using namespace std;
typedef long long ll;

int N, M;
int P[100000], Y[100000];
vector<int> yd[100001];
int main() {
    scanf("%d %d ", &N, &M);
    for (int i = 0; i < M; i++) {
        scanf("%d %d ", &P[i], &Y[i]), yd[P[i]].push_back(Y[i]);
    }

    for (int i = 0; i < N; i++) sort(yd[i + 1].begin(), yd[i + 1].end());

    for (int i = 0; i < M; i++) {
        int rank = lower_bound(yd[P[i]].begin(), yd[P[i]].end(), Y[i]) -
                   yd[P[i]].begin() + 1;
        printf("%06d%06d\n", P[i], rank);
    }
}


Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<int> yd[100001];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:13:40: error: 'yd' was not declared in this scope
   13 |         scanf("%d %d ", &P[i], &Y[i]), yd[P[i]].push_back(Y[i]);
      |                                        ^~
a.cc:16:38: error: 'yd' was not declared in this scope
   16 |     for (int i = 0; i < N; i++) sort(yd[i + 1].begin(), yd[i + 1].end());
      |                                      ^~
a.cc:19:32: error: 'yd' was not declared in this scope
   19 |         int rank = lower_bound(yd[P[i]].begin(), yd[P[i]].end(), Y[i]) -
      |                                ^~
Language: C++

#include <algorithm>
#include <cstdin>

using namespace std;
typedef long long ll;

int N, M;
int P[100000], Y[100000];
vector<int> yd[100001];
int main() {
    scanf("%d %d ", &N, &M);
    for (int i = 0; i < M; i++) {
        scanf("%d %d ", &P[i], &Y[i]), yd[P[i]].push_back(Y[i]);
    }

    for (int i = 0; i < N; i++) sort(yd[i + 1].begin(), yd[i + 1].end());

    for (int i = 0; i < M; i++) {
        int rank = lower_bound(yd[P[i]].begin(), yd[P[i]].end(), Y[i]) -
                   yd[P[i]].begin() + 1;
        printf("%06d%06d\n", P[i], rank);
    }
}


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

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

struct City {
	int P, Y, num;
};

bool cmp(City *a, City *b) {
	if (a->P == b->P) {
		return (a->Y < b->Y);
	}
	return (a->P < b->P);
}

bool cmp1(City *a, City *b) {
	return (a->num < b->num);
}

int ID(void) {
	int N, M;
	std::cin >> N >> M;
	std::vector<City*> cities;

	for (int i = 0; i < M; i++) {
		City *c = new City();
		c->num = i;
		std::cin >> c->P >> c->Y;
		cities.push_back(c);
	}
	for (int i = 0; i < M; i++) {
		std::cout << cities[i]->P << " " << cities[i]->Y << "\n";
	}
	std::sort(cities.begin(), cities.end(), cmp);

	for (int i = 0; i < M; i++) {
		std::cout << cities[i]->P << " " << cities[i]->Y << "\n";
	}
	int num = 1;
	for (int i = 0; i < M - 1; i++) {
		if (cities[i]->P == cities[i + 1]->P) {
			cities[i]->Y = num++;
		} else {
			cities[i]->Y = num;
			num = 1;
		}
	}
	if (cities[M - 1]->P == cities[M - 1]->P)
		cities[M - 1]->Y = num;
	else
		cities[M - 1]->Y = ++num;
	std::sort(cities.begin(), cities.end(), cmp1);
	for (int i = 0; i < M; i++) {
		printf("%06d%06d\n", cities[i]->P, cities[i]->Y);
	}
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

const int SZ=100005;
set<int> st[SZ];
pint id[SZ];
int year_to_idx[SZ];

signed main()
{
    int N,M;
    cin>>N>>M;
    REP(i,M){
        int p,y; cin>>p>>y;
        year_to_idx[y]=i;
        st[p-1].insert(y);
    }

    REP(p,N){
        if(st[p].size()==0) continue;
        int cnt=1;
        for(auto y:st[p]){
            int idx=year_to_idx[y];
            id[idx].first=p+1;
            id[idx].second=cnt;
            cnt++;
        }
    }

    REP(i,M){
        printf("%06lld%06lld\n",id[i].first,id[i].second);
    }

}


Compiler output:
a.cc:3:9: error: 'vector' does not name a type
    3 | typedef vector<int>   vint;
      |         ^~~~~~
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<int,int> pint;
      |         ^~~~
a.cc:7:1: error: 'set' does not name a type
    7 | set<int> st[SZ];
      | ^~~
a.cc:8:1: error: 'pint' does not name a type; did you mean 'int'?
    8 | pint id[SZ];
      | ^~~~
      | int
a.cc: In function 'int main()':
a.cc:14:5: error: 'cin' was not declared in this scope
   14 |     cin>>N>>M;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define int long long
a.cc:15:9: error: 'i' was not declared in this scope
   15 |     REP(i,M){
      |         ^
a.cc:15:5: error: 'REP' was not declared in this scope
   15 |     REP(i,M){
      |     ^~~
a.cc:21:9: error: 'p' was not declared in this scope
   21 |     REP(p,N){
      |         ^
Language: Java

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

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    Map<Integer,int[]> sortup = new TreeMap<>();
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[] P = new int[N];
    int[] ans = new int[M];
    for(int i = 0;i < M ;i++){
      int a = sc.nextInt();
      int b = sc.nextInt();
      int[] c = new int[2];
      c[0] = a;
      c[1] = i;
      sortup.put(b,c);
    }
    for(int key : sortup.keySet()){
      int[] c = sortup.get(key);
      ans[c[1]] = String.format("%06d%06d",c[0],++P[c[0]-1]);
    }
    for(int i = 0;i < M ;i++){
      System.out.println(ans[i]);
    }
  }
}

Compiler output:
Main.java:23: error: incompatible types: String cannot be converted to int
      ans[c[1]] = String.format("%06d%06d",c[0],++P[c[0]-1]);
                               ^
1 error
Language: Java

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

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    Map<Integer,int[]> sortup = new TreeMap<>();
    int N = sc.nextInt();
    int M = sc.nextInt();
    int[] P = new int[N];
    int[] ans = new int[M];
    for(int i = 0;i < M ;i++){
      int a = sc.nextInt();
      int b = sc.nextInt();
      int[] c = new int[2];
      c[0] = a;
      c[1] = i;
      sortup.put(b,c);
    }
    for(int key : sortup.keySet()){
      System.out.println(key);
      int[] c = sortup.get(key);
      ans[c[1]] = String.format("%06d%06d",c[0],++P[c[0]-1]);
    }
    for(int i = 0;i < M ;i++){
      System.out.println(ans[i]);
    }
  }
}

Compiler output:
Main.java:24: error: incompatible types: String cannot be converted to int
      ans[c[1]] = String.format("%06d%06d",c[0],++P[c[0]-1]);
                               ^
1 error
Language: C++

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

int main() {
	int n,m;cin>>n>>m;
  	vector<int> p(m);
  	vector<int> y(m);
  	//県ごとに配列を作成し、県ごとの配列にそれぞれ値をpush_backする。
  	vector<int> yd[n+1];
  	for(int i=0;i<m;i++){
    	cin>>p[i]>>y[i];
      	yd[p[i]].push_back(y[i]);
    }
  	//県ごとにsortする。
  	for(int i=0;i<n;i++){
    	sort(yd[i+1].begin(),yd[i+1].end());	
    }
  　//県番号を出力。続いて県の中の位置を出力する
  	for(int i=0;i<m;i++){
    	cout<<setfill('0')<<right<<setw(6)<<p[i];
      	cout<<setfill('0')<<right<<setw(6)<<lower_bound(yd[p[i]].begin(),yd[p[i]].end(),y[i])-yd[p[i]].begin()+1<<endl;   
    }
}

Compiler output:
a.cc:18:3: error: extended character 　 is not valid in an identifier
   18 |   　//県番号を出力。続いて県の中の位置を出力する
      |   ^
a.cc: In function 'int main()':
a.cc:18:3: error: '\U00003000' was not declared in this scope
   18 |   　//県番号を出力。続いて県の中の位置を出力する
      |   ^~
a.cc:19:21: error: 'i' was not declared in this scope
   19 |         for(int i=0;i<m;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:7:15: error: 'i' was not declared in this scope
    7 | # define rep (i,n)for(int i=0; i< n ;i++)
      |               ^
a.cc:14:9: note: in expansion of macro 'rep'
   14 |         rep(i, M) scanf("% d % d ", &P[i], &Y[i]), yd[P[i]].push_back(Y[i]);
      |         ^~~
a.cc:7:17: error: 'n' was not declared in this scope
    7 | # define rep (i,n)for(int i=0; i< n ;i++)
      |                 ^
a.cc:14:9: note: in expansion of macro 'rep'
   14 |         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:1:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.