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

#include<bits/stdc++.h>

using namespace std;

long long dist(pair<int, int>& a, pair<int, int>& b){
  return abs(a.first - b.first) + abs(a.second - b.second);
}

long long cross(pair<int, int>& a, pair<int, int>& b, pair<int, int>& c){
  return (b.first - a.first) * (b.second - c.second) - (b.second - a.second) * (b.first - c.first);
}

vector<pair<int, int>> convex_hull(vector<pair<int, int>> ps){
  int n = ps.size(), k = 0;
  sort(ps.begin(), ps.end());
  vector<pair<int, int>> ch(2 * n);
  for(int i = 0; i < n; ch[k++] = ps[i++]){
    while(k >= 2 && cross(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
  }
  for(int i = n - 2, t = k + 1; i >= 0; ch[k++] = ps[i--]){
    while(k >= t && cross(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
  }
  ch.resize(k - 1);
  return ch;
}

int main(){
  int N;
  cin >> N;
  
  vector<pair<int, int>> ps(N);
  for(int i = 0; i < N; i++){
    int x, y;
    cin >> x >> y;
    ps[i] = {x, y};
  }
  
  if(N == 2){
    cout << dist(ps[0], ps[1]) << endl;
    return 0;
  }
  
  int k = ch.size();
  
  long long max_dist = 0;
  for(int i = 0, r = 0; i < k; i++){
    while(dist(ch[i], ch[(r + 1) % k]) >= dist(ch[i], ch[r % k])) ++r;
    max_dist = max(dist(ch[i], ch[r % k]), max_dist);
    if(i == r) ++r;
  }
  
  cout << max_dist << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:11: error: 'ch' was not declared in this scope
   43 |   int k = ch.size();
      |           ^~
Language: C++

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

#define ll long long
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))

const int N =100;

bool isprime(int n)
{
    if (n <= 1)
        return false;
    for (int i = 2; i*i<=n; i++)
        if (n % i == 0)
            return false;

    return true;
}
int binarySearch(int arr[], int l, int r, int x)
{
    if (r >= l) {
        int mid = l + (r - l) / 2;
        if (arr[mid] == x)
            return mid;
        if (arr[mid] > x)
            return binarySearch(arr, l, mid - 1, x);
        return binarySearch(arr, mid + 1, r, x);
    }
    return -1;
}
long long lcm(long long a,long long b)
{
    long long p,r;
    p = a*b;
    r = __gcd(a, b);
    return p/r;
}
bool ispalindrome(string s)
{
    int n = s.length();
    for(int i=0;i<n/2;i++)
    {
        if(s[i]!=s[n-i-1])
            return false;
    }
    return true;
}
bool isPerfectSquare(long double x)
{
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);

}
ll f(ll n) {
	return n * (n - 1) / 2;
}
bool cmp(const tuple<int, string, string>& a,
               const tuple<int, string, string>& b)
{
    return (get<0>(a) < get<0>(b));
}

void solve()
{
   ll n;
   cin>>n;
   ll x[n],y[n];
   vector<pair<ll,ll>>temp;
   for(int i=0;i<n;i++)
   {
       cin>>x[i]>>y[i];
       temp.push_back(make_pair(x[i]*x[i]+y[i]*y[i],i));
   }
   sort(temp.begin(),temp.end());

   vector<ll>ans;
   for(int i=1;i<n;i++);
   {
       ll d;
       d= abs(x[temp[n-i].second]-x[temp[0].second]) + abs(y[temp[n-i].second]-y[temp[0].second]);
        ans.push_back(d);
   }
   int p = ans.size();
   sort(ans.begin(),ans.end());
   cout<<ans[p-1]<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:81:24: error: 'i' was not declared in this scope
   81 |        d= abs(x[temp[n-i].second]-x[temp[0].second]) + abs(y[temp[n-i].second]-y[temp[0].second]);
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin >> n;
  long long ans = INT_MIN;
  long long x,y;
  cin >> x >> y;
  vector<pair<long long,long long>>v;
  v.push_back(make_pair(x,y));
  for(int i=1;i<n;i++)
  {
    for(int j=i-1;j>=0;j--)
    {
      ans = max(ans,(abs(v[i].first - v[j].first)+abs(v[i].second - v[j].second));
                }
                }
     cout << ans << endl;
   return 0;
                }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:82: error: expected ')' before ';' token
   16 |       ans = max(ans,(abs(v[i].first - v[j].first)+abs(v[i].second - v[j].second));
      |                ~                                                                 ^
      |                                                                                  )
Language: C++

#include <bits/stdc++.h>
#define x first
#define y second
#pragma gcc optimize("O3")
#pragma gcc optimize("Ofast")
#pragma gcc optimize("unroll-loops")
using namespace std;
const long long INF = 1e18;
typedef long long ll;
typedef long double ld;
typedef pair <int,int> pi;
typedef pair <ll,ll> pl;
typedef vector <int> vec;
int n;
int a[200005][2];

int dist(int x,int y) {return abs(a[x][0]-a[y][0])+abs(a[x][1]-a[y][1]);}

int Find(int x) {
    int mx = x;
    for(int i = 1;i <= n;i++) {
        if(dist(i,x) >= dist(x,mx)) mx = i;
    }
    return mx;
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> n;
    for(int i = 1;i <= n;i++) cin >> a[i][0] >> a[i][1];
    int x = Find(1);
    int y = Find(x);
    int z = FInd(y);
    cout << dist(z,y);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: 'FInd' was not declared in this scope; did you mean 'Find'?
   33 |     int z = FInd(y);
      |             ^~~~
      |             Find
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fine cout<<"fine"<<endl;
#define ll long long int
#define pb push_back
#define FASTIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
const ll inf=(ll)2e18;
const int mod=1e9+7;
bool overflow(ll a,ll b){
    if (a <= (inf+b-1)/b) return false;
    return true;
}
int main(){
FASTIO;
ll n;
cin>>n;
pair<ll,ll> dist[n];
ll case1[n],case2[i];
for(int i=0;i<n;i++){
    cin>>dist[i].ff>>dist[i].ss;
    case1[i]=dist[i].ff+dist[i].ss;
}
sort(case1,case1+n);
ll maxi=0;
for(int i=0;i<n;i++){
    ll cur=dist[i].ff+dist[i].ss;
    maxi=max(maxi,cur-case1[0]);
    maxi=max(maxi,case1[n-1]-cur);
}

ll case2[n];
for(int i=0;i<n;i++){
    case2[i]=dist[i].ff-dist[i].ss;
}
sort(case2,case2+n);
for(int i=0;i<n;i++){
    ll cur=dist[i].ff-dist[i].ss;
    maxi=max(maxi,cur-case2[0]);
    maxi=max(maxi,case2[n-1]-cur);
}
cout<<maxi<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: 'i' was not declared in this scope
   22 | ll case1[n],case2[i];
      |                   ^
Language: C++

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

bool test(int N, vector<int> xs, vector<int> ys) {
	int64_t mn1 = 1e18, mx1 = -1e18, mn2 = 1e18, mx2 = -1e18;
	// vector<int> xs(N), ys(N);
	for (int i = 0; i < N; ++i) {
		int64_t x=xs[i], y=ys[i];
		// cin >> x >> y;
		// xs[i] = x;
		// ys[i] = y;
		if (x+y < mn1) {
			mn1 = x+y;
		}
		if (x+y > mx1) {
			mx1 = x+y;
		}

		if (x-y < mn2) {
			mn2 = x-y;
		}

		if (x-y > mx2) {
			mx2 = x-y;
		}
	}
	int64_t a1 = max(abs(mx1-mn1), abs(mx2-mn2));
	int a2 = -1;
	for (int i = 0; i < N; ++i) {
		for (int j = i+1; j < N; ++j) {
			a2 = max(a2, abs(xs[i]-xs[j])+abs(ys[i]-ys[j]));

		}
	}
	cout << a1 << " " << a2 << endl;
	assert(a1==a2);
}


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

	// default_random_engine re;
	// for (int tc = 0; tc < 10000; ++tc) {
	// 	int N = 10;
	// 	vector<int> xs(N), ys(N);
	// 	for (int i = 0; i < N; ++i) {
	// 		xs[i] = re()%100;
	// 		ys[i] = re()%100;
	// 	}
	// 	test(N,xs,ys);
	// }

	int N;
	cin >> N;

	vector<int> xs(N), ys(N);
	for (int i = 0; i < N; ++i) {
		int64_t x, y;
		cin >> x >> y;
		xs[i] = x;
		ys[i] = y;
		if (x+y < mn1) {
			mn1 = x+y;
		}
		if (x+y > mx1) {
			mx1 = x+y;
		}

		if (x-y < mn2) {
			mn2 = x-y;
		}

		if (x-y > mx2) {
			mx2 = x-y;
		}
	}
	cout << max(abs(mx1-mn1), abs(mx2-mn2)) << endl;
	// int ans = -1;
	// for (int i = 0; i < N; ++i) {
	// 	for (int j = i+1; j < N; ++j) {
	// 		ans = max(ans, abs(xs[i]-xs[j])+abs(ys[i]-ys[j]));

	// 	}
	// }
	// cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:27: error: 'mn1' was not declared in this scope
   64 |                 if (x+y < mn1) {
      |                           ^~~
a.cc:67:27: error: 'mx1' was not declared in this scope
   67 |                 if (x+y > mx1) {
      |                           ^~~
a.cc:71:27: error: 'mn2' was not declared in this scope
   71 |                 if (x-y < mn2) {
      |                           ^~~
a.cc:75:27: error: 'mx2' was not declared in this scope
   75 |                 if (x-y > mx2) {
      |                           ^~~
a.cc:79:25: error: 'mx1' was not declared in this scope
   79 |         cout << max(abs(mx1-mn1), abs(mx2-mn2)) << endl;
      |                         ^~~
a.cc:79:29: error: 'mn1' was not declared in this scope
   79 |         cout << max(abs(mx1-mn1), abs(mx2-mn2)) << endl;
      |                             ^~~
a.cc:79:39: error: 'mx2' was not declared in this scope
   79 |         cout << max(abs(mx1-mn1), abs(mx2-mn2)) << endl;
      |                                       ^~~
a.cc:79:43: error: 'mn2' was not declared in this scope
   79 |         cout << max(abs(mx1-mn1), abs(mx2-mn2)) << endl;
      |                                           ^~~
a.cc: In function 'bool test(int, std::vector<int>, std::vector<int>)':
a.cc:37:1: warning: control reaches end of non-void function [-Wreturn-type]
   37 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,m,n) for(int i=m;i<=n;i++)
#define per(i,m,n) for(int i=m;i>=n;i--)
#define si(x) scanf("%d",&x)
#define pi(x) printf("%d",x)
#define sl(x) scanf("%lld",&x)
#define pl(x) printf("%lld",x)
const int N = 1e6+10;
const int mod = 1e9+7;
const int inf = 1e9+10;
#define maxn 1000086

const int inf=1<<30;

int main() {
    int n,a=-inf,b=inf,c=-inf,d=inf;
    for(scanf("%d",&n);n--;) {
        int x,y;
        scanf("%d%d",&x,&y);
        a=max(a,x+y);
        b=min(b,x+y);
        c=max(c,x-y);
        d=min(d,x-y);
    }
    pi(max(a-b,c-d));
    return 0;
}

Compiler output:
a.cc:15:11: error: redefinition of 'const int inf'
   15 | const int inf=1<<30;
      |           ^~~
a.cc:12:11: note: 'const int inf' previously defined here
   12 | const int inf = 1e9+10;
      |           ^~~
Language: C++

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

typedef long long int ll;
ll pts[100005][2] = { 0 };

ll mnht(ll pt[100005][2], int kth, int idx, int d)
{
	ll dist = 0;

	for (int i = 0; i < d; i++)
	{
		dist += abs(pt[kth][i] - pt[idx][i]);
	}

	return dist;
}
ll max_cmb(ll cmbn[6], ll pt[100005][6], int n, int d)
{
	ll pk = 0; ll idx = 0;

	for (int i = 0; i < n; i++)
	{
		ll val = 0;

		for (int j = 0; j < d; j++)
		{
			val += (1 - 2 * cmbn[j])*pt[i][j];
		}

		if (val > pk)
		{
			pk = val;
			idx = i;
		}
	}

	return idx;
}

int main()
{
	int n, d;
	cin >> n;
	d = 2;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < d; j++)
			cin >> pts[i][j];
	}

	ll pk[2 << d];

	for (int j = 0; j < 1 << (d); j++)
	{
		ll cmbn[6] = { 0 };
		for (int dig = 0; dig < d; dig++)
		{
			if (j & 1 << dig)
				cmbn[dig] = 1;
		}
		
		pk[j] = max_cmb(cmbn, pts, n, d);
	}

	ll maxd = 0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < 1 << (d); j++)
			maxd = max(maxd, mnht(pts, i, pk[j], d));
	}

	cout << maxd << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:39: error: cannot convert 'll (*)[2]' {aka 'long long int (*)[2]'} to 'll (*)[6]' {aka 'long long int (*)[6]'}
   65 |                 pk[j] = max_cmb(cmbn, pts, n, d);
      |                                       ^~~
      |                                       |
      |                                       ll (*)[2] {aka long long int (*)[2]}
a.cc:20:27: note:   initializing argument 2 of 'll max_cmb(ll*, ll (*)[6], int, int)'
   20 | ll max_cmb(ll cmbn[6], ll pt[100005][6], int n, int d)
      |                        ~~~^~~~~~~~~~~~~
Language: C++

#define REP(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ll long long

using namespace std; 

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

    int x[n];
    int y[n];
    int z[n];
    REP(i, n){
        cin >> x[i] >> y[i];
        z[i] = x[i] + y[i];
    }
    
    int xmax = x[0];
    int nmax = z[0];
    int nmin = z[0];

    FOR(i,1, n){
        if(x[i] > xmax) xmax = x[i];
        if(z[i] > nmax) nmax = z[i];
        if(z[i] < nmin) nmin = z[i];
    }
    
    int ans = nmax - nmin;

    nmax = y[0] + xmax-x[0];
    nmin = y[0] + xmax-x[0];
    FOR(i, 1, n){
        z[i] = y[i] + xmax-x[i];
        if(nmax < z[i]) nmax = z[i];        
        if(nmin > z[i]) nmin = z[i];
    }
    if (ans < nmax - nmin) ans = nmax-nmin;
    cout << ans;
  
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define REP(i, n) for(int i = 0;i < n;i++)
a.cc:39:5: error: 'cout' was not declared in this scope
   39 |     cout << ans;
      |     ^~~~
a.cc:39:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#define REP(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ll long long

using namespace std; 

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

    int x[n];
    int y[n];
    int z[n];
    REP(i, n){
        cin >> x[i] >> y[i];
        z[i] = x[i] + y[i];
    }
    
    int xmax = x[0];
    int nmax = z[0];
    int nmin = z[0];
    xmax = x[0];
    FOR(i,1, n){
        if(x[i] > xmax) xmax = x[i];
        if(z[i] > nmax) nmax = z[i];
        if(z[i] < nmin) nmin = z[i];
    }
    
    int ans = nmax - nmin;

    nmax = y[0] + xmax-x[0];
    nmin = y[0] + xmax-x[0];
    FOR(i, 1, n){
        z[i] = y[i] + xmax-x[i];
        if(nmax < z[i]) nmax = z[i];        
        if(nmin > z[i]) nmin = z[i];
    }
    if (ans < nmax - nmin) ans = nmax-nmin;
    cout << ans;

    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define REP(i, n) for(int i = 0;i < n;i++)
a.cc:39:5: error: 'cout' was not declared in this scope
   39 |     cout << ans;
      |     ^~~~
a.cc:39:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
using namespace std;
using ll = long long;

int main() {
  ll n;
  cin >> n;
  ll ppmax = -1e10, ppmin = 1e10;
  ll pmmax = -1e10, pmmin = 1e10;
  for (int i = 0; i < n; i++) {
    ll x, y;
    cin >> x >> y;
    ppmax = max(ppmax, x + y);
    ppmin = min(ppmin, x + y);
    pmmax = max(pmmax, x - y);
    pmmin = min(pmmin, x - y);
  }
  cout << max(ppmax - ppmin, pmmax - pmmin, pmmin - pmmax) << endl;
}


Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:18:14:   required from here
   18 |   cout << max(ppmax - ppmin, pmmax - pmmin, pmmin - pmmax) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

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

	int n; cin >> n;
	vector<int> a(n), b(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	for (int i = 0; i < n; ++i) {
		cin >> b[i];
	}
	reverse(b.begin(), b.end());
	int start = -1, fin = -1;
	for (int i = 0; i < n; ++i) {
		if (b[i] == a[i]) {
			if (start == -1) start = i;
			fin = i;
		}
	}
	bool bad = 0;
	if (start != -1) {
		for (int i = 0, j = start; j <= fin; ++i) {
			if (i == start) i = fin + 1;
			if (i >= n) {
				bad = 1;
				break;
			}
			if (a[i] != b[j] && b[i] != b[j]) {
				swap(b[i], b[j++]);
			}
		}
		for (int i = 0; i < n; ++i)
			bad |= (a[i] == b[i]);
	}
	if (bad) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
		for (int i = 0; i < n; ++i) {
			if (i) cout << " ";
			cout << b[i];
		}
		cout << endl;
	}

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

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

	int n; cin >> n;
	vector<int> a(n), b(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	for (int i = 0; i < n; ++i) {
		cin >> b[i];
	}
	reverse(b.begin(), b.end());
	int start = -1, fin = -1;
	for (int i = 0; i < n; ++i) {
		if (b[i] == a[i]) {
			if (start == -1) start = i;
			fin = i;
		}
	}
	bool bad = 0;
	if (start != -1) {
		for (int i = 0, j = start; j <= fin; ++i) {
			if (i == start) i = fin + 1;
			if (i >= n) {
				bad = 1;
				break;
			}
			if (a[i] != b[j] && b[i] != b[j]) {
				swap(b[i], b[j++]);
			}
		}
		for (int i = 0; i < n; ++i)
			bad |= (a[i] == b[i]);
	}
	if (bad) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
		for (int i = 0; i < n; ++i) {
			if (i) cout << " ";
			cout << b[i];
		}
		cout << endl;
	}

	return 0;
}

Compiler output:
a.cc:52:2: error: stray '#' in program
   52 | }#include <bits/stdc++.h>
      |  ^
a.cc:52:3: error: 'include' does not name a type
   52 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:55:5: error: redefinition of 'int main()'
   55 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

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

using namespace std;
using namespace atcoder;

const string YES = "Yes";

const string NO = "No";

void solve(int N, vector<int> A, vector<int> B) {
    vector<int> cnt_A(N + 1), cnt_B(N + 1);
    for (int i = 0; i < N; i++) {
        cnt_A.at(A.at(i))++;
        cnt_B.at(B.at(i))++;
    }
    for (int i = 1; i <= N; i++) {
        if (cnt_A.at(i) + cnt_B.at(i) > N) {
            cout << NO << endl;
            return;
        }
    }
    cout << YES << endl;
    vector<int> C(N + 1), D(N + 1);
    for (int i = 1; i <= N; i++) {
        C.at(i) = C.at(i - 1) + cnt_A.at(i);
        D.at(i) = D.at(i - 1) + cnt_B.at(i);
    }
    int x = 0;
    for (int i = 1; i <= N; i++) {
        x = max(x, C.at(i) - D.at(i - 1));
    }
    for (int i = 0; i < N - 1; i++) {
        cout << B.at((i + x) % N) << " ";
    }
    cout << B.at((N - 1 + x) % N) << endl;
}

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }
    vector<int> B(N);
    for (int i = 0; i < N; i++) {
        cin >> B.at(i);
    }
    solve(N, move(A), move(B));
    return 0;
}


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

#include <bits/stdc++.h>
#define INF 1e7
#define mod 1000000007

using namespace std;
typedef long long int ll;
typedef tuple<int,int,int> tii;
typedef tuple<long long int,long long int,long long int> tll;
typedef tuple<double,double,double> tdd;


int main()
{
    int N; cin >> N;
    vector<pair<int,char>>v;
    vector<int>A(N);
    for(int i = 0; i < N; i++)
    {
        int a; cin >> a; A[i] = a;
        v.push_back(make_pair(a,'a'));
    }
    for(int i = 0;i < N; i++)
    {
        int b; cin >> b;
        v.push_back(make_pair(b,'b'));
    }
    sort(v.begin(),v.end());
    for(int i = 0; i < N; i++)
    {
        if(v[i].first == v[i+N].first)
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    queue<int>qa,qb;
    for(int i = 0; i < N; i++) 
    {
        if(v[i].second == v[N+i].second && v[i].second == 'a') qa.push(i);
        if(v[i].second == v[N+i].second && v[i].second == 'b') qb.push(i);
    }
    while(!qa.empty())
    {
        int p = qa.front(); qa.pop();
        int q = qb.front(); qb.pop();
        if(v[p].first != v[q].first) swap(v[p+N],v[q]);
        else if(v[p].first != v[q+N].first) swap(v[p+N],v[q+N]);
    }
    for(int i = 0; i < N; i++) if(v[i].second == v[N+i].second) return 1;
    for(int i = 0; i < N; i++) if(v[i].second == b) swap(v[i],v[i+N]);
    vector<pair<int,int>>ans(N);
    for(int i = 0; i < N; i++) ans[i] = make_pair(v[i].first,v[i+N].first);
    sort(ans.begin(),ans.end());
    for(int i = 0; i < N; i++) cout << ans[i].second << " ";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:50: error: 'b' was not declared in this scope
   51 |     for(int i = 0; i < N; i++) if(v[i].second == b) swap(v[i],v[i+N]);
      |                                                  ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
  cout << "No" << endl;
  return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected ';' before '}' token
    8 |   return 0
      |           ^
      |           ;
    9 | }
      | ~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int n,a[1000000],b[1000000];
int f=0;
int main()
{   
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int j=n;j>=1;j--)cin>>b[j];
    for(int i=1;i<=n;i++){
         if(a[i]==b[i]){
                        f++;
                        //int l=lower_bound(b+i+1,b+1+n,a[i])-b;
                        for(int j=i+1;j<=n;j++){
                                if(a[i]!=b[j]){swap(b[i],b[j]);f--;break;}
                                }
                        }   
            }
            
    if(f)cout<<"No";
    else{
         puts("Yes");
         for(int i=1;i<=n;i++)cout<<b[i];
         if(i<n)cout<<" ";
         
         }
    system("pause");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'i' was not declared in this scope
   25 |          if(i<n)cout<<" ";
      |             ^
Language: C++


 #include<stdio.h>
 #include<iostream>
 #include<algorithm> 
using namespace std;
 
const int MAXN=int(2e5+4);


long long seqa[MAXN];
long long seqb[MAXN];
 
 int temp=0; 
 int swap(int a,int b)
 {
     temp=a;
     a=b;
     b=temp; 
 } 
 int main() {
    int n;
    cin>>n;
    for (int i=0; i<n; i++) 
        cin>>seqa[i];
    for (int i=0; i<n; i++)
        cin>>seqb[i];
 
    reverse(b, b+n);
 
    int com=-1;
    int len=n;
    int re=-1;
    for (int i=0; i<n; i++) {
        if (com==-1 && seqa[i]==seqb[i]) {
            com=seqa[i];
            len=i;
            re=i;
        }
         else if (com!=-1 && a[i]==seqb[i]) 
         {
            re=i;
        }
    }

    for (int i=0; i<n; i++) {
        if (com!=a[i] && com!=b[i] &&len<=re)
        {
             
            swap(b[i], b[len]);
            len++;
        }
    }
 
    if (len<=re) {
        printf("No\n");
    } else {
        printf("Yes\n");
        for (int i=0; i<n; i++) {
            printf("%d ",seqb[i]); 
        }
    }
    //system("pause"); 
    return 0;
}


Compiler output:
a.cc: In function 'int swap(int, int)':
a.cc:19:2: warning: no return statement in function returning non-void [-Wreturn-type]
   19 |  }
      |  ^
a.cc: In function 'int main()':
a.cc:28:13: error: 'b' was not declared in this scope
   28 |     reverse(b, b+n);
      |             ^
a.cc:39:30: error: 'a' was not declared in this scope
   39 |          else if (com!=-1 && a[i]==seqb[i])
      |                              ^
a.cc:46:18: error: 'a' was not declared in this scope
   46 |         if (com!=a[i] && com!=b[i] &&len<=re)
      |                  ^
Language: C

#include <bits/stdc++.h>
/** #include <ext/pb_ds/assoc_container.hpp>
 * #include <ext/pb_ds/tree_policy.hpp>
 * using namespace __gnu_pbds; */
using namespace std;

#define ll long long
#define ull unsigned long long
#define f(a, b) for (ll i = a; i < b; i++)
#define mod 1000000007
#define pb push_back
#define vll vector<ll>
#define pll vector<pair<ll, ll>>
#define ld long double
#define fr(a, b) for (ll j = a; j >= b; j--)
#define fi(a, b) for (ll j = a; j < b; j++)
#define fii(a, b) for (ll k = a; k < b; k++)
/** typedef tree<ll
 * ,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
 * ordered_set; */

template <class T> ostream &operator<<(ostream &os, vector<T> V) {
  os << "[ ";
  for (auto v : V)
    os << v << " ";
  os << "]";
  return os;
}
template <class T> ostream &operator<<(ostream &os, set<T> S) {
  os << "{ ";
  for (auto s : S)
    os << s << " ";
  return os << "}";
}
template <class L, class R> ostream &operator<<(ostream &os, map<L, R> M) {
  os << "{ ";
  for (auto m : M)
    os << "(" << m.first << ":" << m.second << ") ";
  return os << "}";
}
template <class L, class R> ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}

struct compare {
public:
  bool operator()(const pair<ll, vector<ll>> &a,
                  const pair<ll, vector<ll>> &b) {
    return a.second.size() < b.second.size() || a.first < b.first;
  }
};

const ll N = 200005;
ll a[N], b[N];
vll same[N];

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n;
  cin >> n;
  f(1, n + 1) cin >> a[i];
  f(1, n + 1) cin >> b[i];
  f(1, n + 1) if (a[i] == b[i]) same[a[i]].push_back(i);
  set<pair<ll, vector<ll>>, compare> s;
  f(1, n + 1) if (!same[i].empty()) s.insert({i, same[i]});
  while (s.size() > 2) {
    vector<ll> v1 = (--s.end())->second;
    ll val1 = (--s.end())->first;
    s.erase(--s.end());
    vector<ll> v2 = (--s.end())->second;
    ll val2 = (--s.end())->first;
    s.erase(--s.end());
    swap(b[v1.back()], b[v2.back()]);
    v1.pop_back();
    v2.pop_back();
    if (!v1.empty())
      s.insert({val1, v1});
    if (!v2.empty())
      s.insert({val2, v2});
  }
  if (s.empty()) {
    cout << "Yes\n";
    f(1, n + 1) cout << b[i] << ' ';
    return 0;
  }
  vll eligible;
  vll v = s.begin()->second;
  ll val = s.begin()->first;
  s.clear();
  f(1, n + 1) {
    if (!(b[i] == val || a[i] == val))
      eligible.push_back(i);
  }
  if (eligible.size() < v.size()) {
    cout << "No\n";
    return 0;
  }
  while (!v.empty()) {
    swap(b[v.back()], b[eligible.back()]);
    v.pop_back();
    eligible.pop_back();
  }
  cout << "Yes\n";
  f(1, n + 1) cout << b[i] << ' ';

  return 0;
}

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

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
const int Maxn=200010;
int max(int x,int y){return x>y?x:y;}
int n,a[Maxn],b[Maxn],c[Maxn],L[Maxn],R[Maxn],cc[Maxn],ans[Maxn],B[Maxn];
struct Node
{
	int l,r,lc,rc,mx,p,tag;
}tr[Maxn<<1];
int tot=0;
void merge(int x)
{
	int lc=tr[x].lc,rc=tr[x].rc;
	tr[x].mx=max(tr[lc].mx,tr[rc].mx); 
	if(tr[x].mx==tr[lc].mx)tr[x].p=tr[lc].p;
	else tr[x].p=tr[rc].p;
} 
void w(int x,int v)
{
	tr[x].tag+=v;
	tr[x].mx-=v;
}
void down(int x)
{
	if(tr[x].tag)
	{
		int v=tr[x].tag;
		w(tr[x].lc,v);w(tr[x].rc,v);
		tr[x].tag=0;
	}
}
void build(int l,int r)
{
	int x=++tot;
	tr[x].l=l;tr[x].r=r;tr[x].tag=0;
	if(l==r)
	{
		tr[x].p=l;tr[x].mx=c[a[l]];
		return;
	}
	int mid=l+r>>1;
	tr[x].lc=tot+1;build(l,mid);
	tr[x].rc=tot+1;build(mid+1,r);
	merge(x);
}
void m2(int x,int l,int r,int v)
{
	if(tr[x].l==l&&tr[x].r==r){w(x,v);return;}
	int mid=tr[x].l+tr[x].r>>1,lc=tr[x].lc,rc=tr[x].rc;
	down(x);
	if(r<=mid)m2(lc,l,r,v);
	else if(l>mid)m2(rc,l,r,v);
	else m2(lc,l,mid,v),m2(rc,mid+1,r,v);
	merge(x);
}
void m3(int x,int p,int v)
{
	if(tr[x].l==tr[x].r)
	{
		ans[p]=v;tr[x].mx=-1;
		return;
	}
	int mid=tr[x].l+tr[x].r>>1,lc=tr[x].lc,rc=tr[x].rc;
	down(x);
	if(p<=mid)m3(lc,p,v);
	else m3(rc,p,v);
	merge(x);
}
int Mx,P;
void m4(int x,int l,int r)
{
	if(tr[x].l==l&&tr[x].r==r)
	{
		if(tr[x].mx>Mx)
		{
			Mx=tr[x].mx;
			P=tr[x].p;
		}
		return;
	}
	int mid=tr[x].l+tr[x].r>>1,lc=tr[x].lc,rc=tr[x].rc;
	down(x);
	if(r<=mid)m4(lc,l,r);
	else if(l>mid)m4(rc,l,r);
	else m4(lc,l,mid),m4(rc,mid+1,r);
	merge(x);
}
int main()
{
	memset(c,0,sizeof(c));
	memset(cc,0,sizeof(cc));
	memset(L,-1,sizeof(L));
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);cc[a[i]]++;
		R[a[i]]=i;
		if(L[a[i]]==-1)L[a[i]]=i;
	}
	for(int i=1;i<=n;i++)scanf("%d",&b[i]),c[b[i]]++;
	for(int i=1;i<=n;i++)
	if(c[b[i]]>n-cc[b[i]])return puts("No"),0;
	build(1,n);
	for(int i=1;i<=n;i++)
	{
		Mx=-2147483647;
		if(L[b[i]]==-1)m4(1,1,n);
		else
		{
			if(L[b[i]]!=1)m4(1,1,L[b[i]]-1);
//			printf("%d %d %d %d\n",i,Mx,P,R[b[i]]+1);
			if(R[b[i]]!=n)m4(1,R[b[i]]+1,n);
			m2(1,L[b[i]],R[b[i]],1);
		}
		m3(1,P,b[i]); 
//		printf("%d %d %d %d\n",i,P,b[i],Mx);
	}
	for(int i=1;i<=n;i++)
	if(ans[i]==a[i])return puts("No"),0;
	for(int i=1;i<=n;i++)B[i]=ans[i];
	sort(B+1,B+1+n);
	for(int i=1;i<=n;i++)
	if(B[i]!=b[i])return puts("No"),0;
	puts("Yes");
	for(int i=1;i<=n;i++)printf("%d ",ans[i]);
} 

Compiler output:
main.c:3:9: fatal error: iostream: No such file or directory
    3 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <stdint.h>
#include <string.h>

#define _USE_MATH_DEFINES
#include <math.h>

#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <string>

#include <algorithm>
#include <functional>
#include <bitset>
#include <functional>
#include <chrono>
#include <random>

#define sqr(x) (x) * (x)

typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

using namespace std;
using namespace std::chrono;

//const i64 mod = 1'000'000'000ll + 7;
const i64 smod = 998244353ll;

//const i64 inf = mod;

const long double eps = 1e-8;

int main(int argc, char* argv[]) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(15); cout.setf(ios::fixed); cerr.precision(15); cerr.setf(ios::fixed);

    cin >> n;

    vector<i64> a(n);
    vector<i64> b(n);

    for (i64 i = 0; i < n; i++) {
        cin >> a[i];
    }

    for (i64 i = 0; i < n; i++) {
        cin >> b[i];
    }

    map<i64, i64> c;

    for (i64 i = 0; i < n; i++) {
        c[b[i]] += 1;
    }

    map<i64, set<i64>> p;
    for (i64 i = 0; i < n; i++) {
        p[a[i]].insert(i);
    }

    set<pair<i64, i64>, greater<pair<i64, i64>>> q;
    for (auto t : c) {
        q.insert({ t.second, t.first });
    }

    vector<i64> x;
    for (auto t : q) {
        i64 cnt = t.first;
        i64 val = t.second;
        for (auto i : p[val]) {
            x.push_back(i);
        }
        p.erase(val);
    }




    vector<i64> z(n);
    set<i64> e;

    for (auto t : p) {
        for (auto i : t.second) {
            e.insert(i);
        }
    }

    i64 i = 0;

    while (!q.empty()) {
        i64 cnt = q.begin()->first;
        i64 val = q.begin()->second;
        q.erase(q.begin());

        set<i64> ne;

        while (i < x.size() && a[x[i]] == val) {
            ne.insert(x[i]);
            i += 1;
        }

        while (cnt > 0 && i < x.size()) {
            z[x[i]] = val;
            //cerr << x[i] << ": " << val << endl;
            i += 1;
            cnt -= 1;
        }

        while (cnt > 0 && !e.empty()) {
            z[*e.begin()] = val;
            //cerr << *e.begin() << ": " << val << endl;
            e.erase(e.begin());
            cnt -= 1;
        }

        if (cnt) {
            cout << "No" << endl;
            return 0;
        }

        for (auto t : ne) {
            e.insert(t);
        }
    }

    cout << "Yes" << endl;
    for (auto t : z) {
        cout << t << " ";
    }


    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:56:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   56 |     cin >> n;
      |            ^
      |            yn
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int Mod=1e9+7;
const int INF=0x3f3f3f3f;

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);
	//get prepared
	int n;
	cin>>n;
	queue<int> a,b,ans;
	for(int i=0; i<n; ++i) {
		int tmp;
		cin>>tmp;
		a.push(tmp);
	}
	a.push(INF);
	for(int i=0; i<n; ++i) {
		int tmp;
		cin>>tmp;
		b.push(tmp);
	}
	b.push(INF);
	
	//main part	
	int cnt=2;
	bool flag=0;
	while(cnt){
		//judge
		if(b.front()==INF){
			--cnt;
			if(a.front()==INF){
				++flag;
				break;
			}
			else{
				int tmp=b.front();
				b.push(tmp);
				b.pop();
			}
		} 
		
		//perform
		if(b.front()!=a.front()){
			a.pop();
			int tmp=b.front();
			ans.push(tmp);
			b.pop();
		}
		else {
			int tmp=b.front();
			b.push(tmp);
			b.pop();
		}
	}
	if(flag){
		cout<<"Yes"<<endl;
		while(!ans.empty()){
			cout<<ans.front()<<' ';
			ans.pop();
		}
		cout<<endl;
	}
	else cout<<"No"<<endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:35: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   38 |                                 ++flag;
      |                                   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
    int n;
    cin >> n;
    vector<int> a(n),b(n);
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++)cin>>b[i];
    vector<int> s(n+1),t(n+1);
    for(int i=0;i<n;i++){
    	s[a[i]]++;
		t[b[i]]++;
	}
    for(int i=0;i<=n;i++)
    if(s[i]+t[i]>n){
        cout<<"No"<<endl;
        return 0;
    }
    for(int i=0;i<n;i++){
    	s[i+1]+=s[i];
		t[i+1]+=t[i];
	}
    int x=-2e5-10;
    for(int i=0;i<n;i++)x=max(x,s[i+1]-t[i]);
    cout<<"Yes"<<endl;
    for(int i=0;i<n;i++){
    	cout<<b[(i+n-x)%n];
		if(i==n-1)cout<<endl;
		else cout<<' ';
	}
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:33:14: error: expected '}' at end of input
   33 |     return 0;
      |              ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

const int SIZE = 2e5+10;
int n;
int a[SIZE], b[SIZE];

inline int read()
{
	int x=0;char ch=getchar();
	while(!isidigit(ch)) ch=getchar();
	while(isdigit(ch)){x=x*10+(ch-'0'); ch=getchar();}
	return x;
}

int main()
{
//	scanf("%d", &n);
//	for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
//	for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
	n=read();
	for (int i = 1; i <= n; ++i) a[i]=read();
	for (int j = 1; j <= n; ++j) b[i]=read();
	for (int i = 1; i <= (n>>1);++i) swap(b[i], b[n-i+1]);
	for (int i = 1; i <= n; ++i)
	{
		if (a[i] == b[i])
		{
			for (int j = 0; j <= n>>1; ++j)
			{
				int f = 0;
				if (b[j+1] != a[i]) 
				{
					f = 1; swap(b[j+1], b[i]); break;
				}
				if (!f && b[n-j] != a[i])
				{
					f = 1; swap(b[n-j], b[i]); break;
				}
			}
		}
	}
	int p = 0;
	for (int i = 1; i <= n; ++i)
	{
		if (a[i] == b[i]) 
		{
			p = 1; printf("No\n"); break;
		}
	}
	if (!p) 
	{
		printf("Yes\n");
		for (int i = 1; i <= n; ++i)
			printf("%d ", b[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int read()':
a.cc:11:16: error: 'isidigit' was not declared in this scope; did you mean 'isxdigit'?
   11 |         while(!isidigit(ch)) ch=getchar();
      |                ^~~~~~~~
      |                isxdigit
a.cc: In function 'int main()':
a.cc:23:40: error: 'i' was not declared in this scope
   23 |         for (int j = 1; j <= n; ++j) b[i]=read();
      |                                        ^
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ull unsigned long long int
#define ll long long int
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define MOD (ull)(double)(1e9 + 7)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vb vector<bool>
#define vd vector<double>
#define vll vector<ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define vvi vector<vi>
#define vvll vector<vll>
#define vs vector<string>
#define pull pair<ull, ull>
#define F first
#define S second
#define m_p make_pair
#define debug(x) cout << #x << " " << x << endl
#define printArr(a, start, end)for(int i=start ; i<end ; ++i)cout << a[i] << " ";cout << '\n';
#define readArr(a, start, end)for(int i=start ; i<end ; ++i)cin >> a[i];
#define read2D(mat, n, m)for(int i=0 ; i<n ; ++i)for(int j=0 ; j<m ; ++j)cin >> mat[i][j];

const long double PI = 3.141592653589793238462643383279502884197169399;

// Find Set LSB = (x&(-x)), isPowerOfTwo = (x & (x-1))

void solve(){
	int n;
	cin >> n;
	
	vi a(n);
	for(int& x : a)cin >> x;
	
	vi b(n);
	for(int& x : b)cin >> x;
	
	reverse(all(b));
	
	int l=0, r=n-1;
	for(int i=0 ; i<p ; ++i){
		if(a[i] != b[i])continue;
		
		if(a[l] != b[i] && b[l] <= b[i]){
			swap(b[i], b[l]);
			++l;
		}
		else if(a[r] != b[i] && b[r] != b[i]){
			swap(b[i], b[r]);
			--r;
		}
		else{
			cout << "No";
			return;
		}
	}
	
//	for(int i=0 ; i<n ; ++i){
//		if(a[i] == b[i]){
//			cout << "No";
//			return;
//		}
//	}
	
	cout << "Yes\n";
	for(int& x : b)cout << x << " ";
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	cout << fixed << setprecision(10);
	
	int tt=1;
	//cin >> tt;
	
	while(tt--){
		solve();
	}
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:52:25: error: 'p' was not declared in this scope
   52 |         for(int i=0 ; i<p ; ++i){
      |                         ^
Language: Java

import java.io.*;
import java.util.*;

public class Main{
  Scanner sc = new Scanner(System.in);
  void run(){
    int n = sc.nextInt();
    int[] a = new int[n];
    int[] count = new int[n+1];
    for(int i = 0; i<n ;i++){
      a[i] = sc.nextInt();
      count[a[i]]++;
    }
    int max = Arrays.stream(count).max().get();
    if(max >= n/2){
      System.out.println("No");
    }
    System.out.println("Yes");
    int off = n/2;
    for(int i = 0; i< n;i++){
      if(i != 0){
        System.out.print(" ");
      }
      System.out.print(a[(i+off)%n]);
    }
    System.out.println();
  }
  public static void main(String[] args){
    Maim m = new Main();
    m.run();
  }
}

Compiler output:
Main.java:14: error: cannot find symbol
    int max = Arrays.stream(count).max().get();
                                        ^
  symbol:   method get()
  location: class OptionalInt
Main.java:29: error: cannot find symbol
    Maim m = new Main();
    ^
  symbol:   class Maim
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main{
  Scanner sc = new Scanner(System.in);
  void run(){
    int n = sc.nextInt();
    int[] a = new int[n];
    int[] count = new int[n+1];
    for(int i = 0; i<n ;i++){
      a[i] = sc.nextInt();
      count[a[i]]++;
    }
    int max = Arrays.stream(count).max();
    if(max >= n/2){
      System.out.println("No");
    }
    System.out.println("Yes");
    int off = n/2;
    for(int i = 0; i< n;i++){
      if(i != 0){
        System.out.print(" ");
      }
      System.out.print(a[(i+off)%n]);
    }
    System.out.println();
  }
  public static void main(String[] args){
    Maim m = new Main();
    m.run();
  }
}

Compiler output:
Main.java:14: error: incompatible types: OptionalInt cannot be converted to int
    int max = Arrays.stream(count).max();
                                      ^
Main.java:29: error: cannot find symbol
    Maim m = new Main();
    ^
  symbol:   class Maim
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.*;

public class Contrast {
    public static void main(String[] args) throws Exception {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(buffer.readLine());
        String [] inp = buffer.readLine().split(" ");
        Integer []arr = new Integer[n];
        int [] arr2 = new int[n];
        for (int pos = 0; pos < n; pos++) {
            arr[pos] = Integer.parseInt(inp[pos]);
        }
        inp = buffer.readLine().split(" ");
        for (int pos = 0; pos < n; pos++) {
            arr2[pos] = Integer.parseInt(inp[pos]);
        }
        Queue<Integer>balancedPos = new LinkedList<>();
        for (int pos = 0; pos < n; pos++) {
            if (arr[pos] == arr2[pos]){
                if (!balancedPos.isEmpty() && arr[balancedPos.peek()]!=arr2[pos]){
                    int i = balancedPos.poll();
                    arr2[i] = arr2[pos]^arr2[i]^(arr2[pos] = arr2[i]);
                }
                else
                    balancedPos.add(pos);
            }
        }
        int size = 0;
        while (!balancedPos.isEmpty() && balancedPos.size()!=size){
            size = balancedPos.size();
            for (int pos = 0; pos < n; pos++) {
                if (arr[pos]!=arr2[pos] && !balancedPos.isEmpty() && arr[balancedPos.peek()]!=arr2[pos] && arr2[balancedPos.peek()]!=arr[pos]){
                    int i = balancedPos.poll();
                    arr2[i] = arr2[i]^arr2[pos]^(arr2[pos] = arr2[i]);
                }
            }
        }
        if (!balancedPos.isEmpty())
            System.out.println("No");
        else {
            System.out.println("Yes");
            for (int num : arr2) {
                System.out.print(num + " ");
            }
        }
    }
}


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

/* author:hellojim */
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define forn(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define fore(i,b,a)for(int i=(b),_a=(a);i>=_a;i--)
#define rep(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pii>
#define m_p make_pair
#define re return
#define pb push_back
#define si set<int>
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define mod 1000000007
#define INF 1000000007
#define x1 XZVJDFADSPFOE
#define y1 GASDIJSLDAEJF
#define x2 DFDAJKVOHKWIW
#define y2 PSFSAODSXVNMQ
#define LLINF 0x3f3f3f3f3f3f3f3fLL
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
ll quickpower(ll n,ll k){
	ll ans=1;
	while(k){
		if(k%2){
			ans*=n;
			ans%=mod;
		}
		n*=n;
		n%=mod;
		k/=2;
	}
	return ans;
}
string int_to_string(int n)
{
	string s="";
	while(n)
	{
		int now=n%10;
		s+=now+'0';
		n/=10;
	}
	reverse(s.begin(),s.end());
	return s;
}
int string_to_int(string s)
{
	int n=0;
	rep(i,s.size())
	{
		n*=10;
		n+=s[i]-'0';
	}
	return n;
}
int a[200100];
int b[200100];
int numa[200100];
int numb[200100];
int n;
int main()
{
	ios::sync_with_stdio(0);
	//think twice,code once
	cin>>n;
	rep(i,n)cin>>a[i],numa[a[i]]++;
	rep(i,n)cin>>b[i],numb[b[i]]++;
	sort(a,a+n);
	sort(b,b+n);
	rep(i,200001)if(numa[i]+numb[i]>n)
	{
		cout<<"No\n";
		return 0;
	}
	int sum,pos;
	bool f1=0;
	rep(i,n)if(a[i]==b[i])f1=1;
	if(!f1)
	{
		cout<<"Yes\n";
		rep(i,n)cout<<b[i]<<" ";
		cout<<endl;
		return 0;
	}
	reverse(b,b+n);
	bool f=0;
	int num;
	int ps1,ps2;
	for(int i=0;i<n;i++)
	{
		if(f)break;
		if(a[i]==b[i])
		{
			num=a[i];
			for(int j=i+1;j<=n;j++)
				if(j==n)
				{
					sum=j-i;
					f=1;
					pos=i;
					break;
				}
				else if(a[j]!=b[j])
				{
					sum=j-i;
					f=1;
					pos=i;
					break;
				}
		}
	}
	rep(i,n)if(a[i]==num)ps1=i;
	rep(i,n)if(b[i]==num)ps1=min(p1,i);
	fore(i,n-1,0)if(a[i]==num)ps2=i;
	fore(i,n-1,0)if(b[i]==num)ps2=max(ps2,i);
	bool fl=0;
	int sum1=0;
	int pos2;
	if(f)for(int i=0;i<min(ps1,sum);i++)
	{
		if(i>=ps1){fl=1;sum1=sum-i;pos2=i+pos;break;}
		swap(b[i],b[pos+i]);
	}
	//cout<<pos2<<" "<<sum1<<endl;
	pos2=max(pos2,ps2);
	if(f&&fl)for(int i=0;i<sum1;i++)
	{
		swap(b[pos2+i],b[ps2+sum+i]);
	}
	cout<<"Yes\n";
	rep(i,n)cout<<b[i]<<" ";
	cout<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:151:38: error: 'p1' was not declared in this scope; did you mean 'ps1'?
  151 |         rep(i,n)if(b[i]==num)ps1=min(p1,i);
      |                                      ^~
      |                                      ps1
Language: C++

//https://atcoder.jp/contests/abc178/tasks/abc178_f
#include <bits/stdc++.h>

using namespace std;

const int MAXN=2e5+4;
long long a[MAXN];
long long b[MAXN];

int main() {
    int n;
    cin>>n;
    for (int i=0; i<n; i++) {
        cin>>a[i];
    }
    for (int i=0; i<n; i++) {
        cin>>b[i];
    }

    reverse(b, b+n);

    //寻找重合的区间
    int c=-1;
    int l=n;
    int r=-1;
#if 1
    for (int i=0; i<n; i++) {
        if (-1==c && a[i]==b[i]) {
            //第一次出现相等
            c=a[i];
            l=i;
        } else if (-1!=c && (!(c==a[i] && c==b[i])) {
            //最后一次出现相等
            r=i-1;
        }
    }
    //cout<<l<<" "<<r<<"\n";
#else
    l=n;
    r=-1;
    for (int i=0; i<n; i++) {
        if (a[i]==b[i]) {
            c=a[i];
            break;
        }
    }
    for (int i=0; i<n; i++) {
        if (c==a[i] && c==b[i]) {
            l=min(l, i);
            r=max(r, i);
        }
    }
    cout<<l<<" "<<r<<"\n";
#endif

    //交换数据
    for (int i=0; i<n; i++) {
        if (c!=a[i] && c!=b[i] && l<=r) {
            swap(b[i], b[l]);
            l++;
        }
    }

    if (l<=r) {
        cout<<"No\n";
    } else {
        cout<<"Yes\n";
        for (int i=0; i<n; i++) {
            cout<<b[i]<<" ";
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:52: error: expected ')' before '{' token
   32 |         } else if (-1!=c && (!(c==a[i] && c==b[i])) {
      |                   ~                                ^~
      |                                                    )
a.cc:36:5: error: expected primary-expression before '}' token
   36 |     }
      |     ^