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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int P = 1e9+7;
const int inv =  5e8+4;
int Pow(int a,int b){
	if(b==0) return 1;
	int ret = Pow(a,b>>1);
	ret=1ll*ret*ret%P;
	if(b&1) ret=1ll*ret*a%P;
	return ret;
}
int n,K,ans,q[100000];
map<int,int> POW,F; 
inline add(int &x,int y ){x=(x+y)%P;}

int main(){
	cin>>n>>K;
	int t,l;
	for(int i=1;1ll*i*i<=n;i++) if(n%i==0){
		//cout<<i<<endl;
		POW[i] = Pow(K,(i+1)>>1);
		t = n/i;
		POW[t] = Pow(K,(t+1)>>1);
	}
	//cout<<POW[n]<<endl;
	int cnt = 0;
	for(int i=1;1ll*i*i<=n;i++) if(n%i==0){
		//cout<<i<<endl;
		t = i;
		l = n/t;
		add(F[t],POW[t]);
		for(int j=2;1ll*j*j<=l;j++) if(l%j==0){
			add(F[j*t],-F[t]);
			if(j*j!=l) add(F[t*(l/j)],-1ll*F[t]%P);
		}
		if(n!=t) add(F[n],-1ll*F[t]%P);
		if(t&1) add(ans,1ll*F[t]*t%P);
		else add(ans,1ll*t*F[t]%P*inv%P);
		
		if(i*i!=n)q[++cnt] = n/i;
	}
	//cout<<"YYY"<<endl;
	for(int i=cnt;i>0;i--){
		t = q[i];
		l = n/t;
		add(F[t],POW[t]);
		for(int j=2;1ll*j*j<=l;j++) if(l%j==0){
			add(F[j*t],-F[t]);
			if(j*j!=l) add(F[t*(l/j)],-1ll*F[t]%P);
		}
		if(n!=t) add(F[n],-1ll*F[t]%P);
		//add(ans,1ll*F[t]*t%P);
		//if(t!=n) add(ans,1ll*F[t]*t%P);
		//else {
		if(t&1) add(ans,1ll*F[t]*t%P);
		else add(ans,1ll*F[t]*t%P*inv%P);
		//}
	}
	
	ans =(ans+P)%P;
	cout<<ans<<endl;
	return 0;	
}

Compiler output:
a.cc:15:8: error: ISO C++ forbids declaration of 'add' with no type [-fpermissive]
   15 | inline add(int &x,int y ){x=(x+y)%P;}
      |        ^~~
a.cc: In function 'int add(int&, int)':
a.cc:15:37: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | inline add(int &x,int y ){x=(x+y)%P;}
      |                                     ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <set>
#include <map>
#include <unordered_map>
#include <vector>
#include <queue>
#include <string>
#include <iomanip>
#include <stdio.h>
#include <cstring>
#include <random>
#include <chrono>
#include <bitset>
#include <fstream>
#include <sstream>
 
using namespace std;
using namespace std::chrono;
 
/*
#define trav(a, v) for(auto& a : v)
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(int i = a; i < (b); ++i)
*/
 
typedef long long ll;
typedef long double ld;
 
ll big = 1000000007ll;
ll n,m,k,r;
 
 
ll mob(ll i){
    if(i == 1)return 1;
    for(ll c1 = 2; c1*c1 <= i; c1++){
        
        if(i % c1 == 0){
            
            if(i % (c1*c1) == 0)return 0;
            return (-1) * mob(i / c1);
        }
    }
 return -1;
}
 

ll ans = 0;
 
 ll upp(ll i, ll j){
 
 if(j == 0)return 1;
 
 if(j%2 == 0){
    ll h = upp(i,j/2);
    return (h*h)%big;
    
 }
 return (i*upp(i,j-1))%big;
 }
 
 
ll g(ll i){
    ll a = mob(n/i) * upp(k, (n+1)/2);
    a += big;
    a %= big;
    if(i % 2 == 0){a *= i/2;}
    else{
        a *= i;
    }
    a%=big;
    return a;
}
 
 
ll f(ll i){

    
    for()


}
 
int main()
{
 
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll c1,c2,c3,c4,c5,c6;
    ll a,b,c,e;
    ll x;
    
    cin >> n >> k;
    
    
    for(ll c1 = 1; c1*c1 <= n; c1++){
        
        if(n%c1 == 0){
            ans += g(c1);
            ans += big;
            ans %= big;
            
            if(c1*c1 != n){
    
                ans += g(n/c1);
                ans += big;
                ans %= big;
            }
        }
    }
    
    cout << ans << "\n";
 
    return 0;
}

Compiler output:
a.cc: In function 'll f(ll)':
a.cc:81:9: error: expected primary-expression before ')' token
   81 |     for()
      |         ^
a.cc:84:1: error: expected primary-expression before '}' token
   84 | }
      | ^
a.cc:81:10: error: expected ';' before '}' token
   81 |     for()
      |          ^
      |          ;
......
   84 | }
      | ~         
a.cc:84:1: error: expected primary-expression before '}' token
   84 | }
      | ^
a.cc:81:10: error: expected ')' before '}' token
   81 |     for()
      |        ~ ^
      |          )
......
   84 | }
      | ~         
a.cc:84:1: error: expected primary-expression before '}' token
   84 | }
      | ^
a.cc:84:1: warning: no return statement in function returning non-void [-Wreturn-type]
Language: C++

#include <bits/stdc++.h>
#define ft first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pt(sth) cout << sth << "\n"
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef map<ll, ll> Map;
static const ll INF=1e18;
static const ll MAX=1e5+7;
static const ll MOD=1e9+7;
void chmax(ll a, ll b) {if(a<b) a=b;}
void chmin(ll a, ll b) {if(a>b) a=b;}
ll max(ll a, ll b) {return a>b ? a:b;}
ll min(ll a, ll b) {return a<b ? a:b;}

ll moP(ll x, ll n) {
    ll res=1;
    while(n>0) {
        if(n&1) moC(res, *, x);
        moC(x, *, x);
        n>>=1;
    }
    return res;
}

int main(void) {
    ll N;
    cin >> N;
    P p[MAX*2];
    ll i;
    
    ll fa[MAX];
    fa[0]=1;
    for(i=1; i<MAX; i++)
        fa[i]=i*fa[i-1]%MOD;
    
    for(i=0; i<N; i++) {
        cin >> p[i].ft;
        p[i].sc=0;
    }
    for(i=N; i<2*N; i++) {
        cin >> p[i].ft;
        p[i].sc=1;
    }
    sort(p, p+2*N);
    
    
    ll ans=1;
    stack<ll> st;
    for(i=0; i<2*N; i++) {
        if(st.size()==0) st.push(p[i].sc);
        else if(st.top()==p[i].sc) st.push(p[i].sc);
        else {
            ll t=0;
            while(st.size()!=0 && st.top()!=p[i].sc) {
                t++;
                i++;
                st.pop();
            }
            
            st.push(p[i].sc)
            
            moC(ans, *, fa[t]);
            
        }
        
    }
    
    pt(ans);
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:20: error: void value not ignored as it ought to be
   66 |             st.push(p[i].sc)
      |             ~~~~~~~^~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const long long mod = 1e9 + 7;

int main(void){
    int n;
    cin >> n;
    vector<pair<int, int> > a;
    for (int i = 0; i < n; ++i){
        int p;
        cin >> p;
        a.push_back(make_pair(p, 0));
    }
    for (int i = 0; i < n; ++i){
        int p;
        cin >> p;
        a.push_back(make_pair(p, 1));
    }
    sort(a.begin(), a.end());
    long long ans = 1, x = 0, y = 0;
    for (int i = 0; i < 2 * n; ++i){
        if (a[i].second == 0){
            if (y){
                ans = (ans * y) % mod;
                y--;
            }else{
                x++;
            }
        }else{
            if (x){
                ans = (ans * x) % mod;
                x--;
            }else{
                y++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define MOD 1000000007
#define INF 1 << 30

using namespace std;
typedef long long ll;

int main(void) {
	int ax, ay, bx, by, cx, cy;
	double S, r, a, b, c, m = 0.0, ans = 0.0;
	cin >> ax >> ay >> bx >> by >> cx >> cy;
	bx -= cx;
	by -= cy;
	ax -= cx;
	ay -= cy;
	cx = cy = 0;
	S = abs(ax * by - bx * ay);
	a = sqrt(abs(ax - bx) * abs(ax - bx) + abs(ay - by) * abs(ay - by));
	b = sqrt(abs(ax - cx) * abs(ax - cx) + abs(ay - cy) * abs(ay - cy));
	c = sqrt(abs(cx - bx) * abs(cx - bx) + abs(cy - by) * abs(cy - by));
	r = S / (a + b + c);
	a = max(a, max(b, c));
	ans = a * r / (2.0 * r + a);
	printf("%.10lf\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'sqrt' was not declared in this scope
   21 |         a = sqrt(abs(ax - bx) * abs(ax - bx) + abs(ay - by) * abs(ay - by));
      |             ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<iomanip>
#include<set>
#define DB double
DB x[3], y[3];
DB M, G[3];
DB s;
DB pow(DB n) { return n * n; }
int main() {
	for (int i = 0; i < 3; i++) {
		std::cin >> x[i] >> y[i];
	}
	for (int i = 0; i < 3; i++) {
		G[i] = std::hypot(x[i] - x[(i + 1) % 3],y[i] - y[(i + 1) % 3]);
		M = std::max(M, G[i]);
		s += G[i];
	}
	s /= 2;
	DB r = std::sqrt(s*(s - G[0])*(s - G[1])*(s - G[2]));
	r /= s;
	DB x = M * r;
	x /= (2 * r + M);
	std::cout <<std::fixed<<std::setprecision(12)<< x << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: 'hypot' is not a member of 'std'
   15 |                 G[i] = std::hypot(x[i] - x[(i + 1) % 3],y[i] - y[(i + 1) % 3]);
      |                             ^~~~~
a.cc:20:21: error: 'sqrt' is not a member of 'std'; did you mean 'sort'?
   20 |         DB r = std::sqrt(s*(s - G[0])*(s - G[1])*(s - G[2]));
      |                     ^~~~
      |                     sort
Language: C++

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

const int MAX_N = 1e5 + 5, MAX_M = 40;
int n, x, ans, p;
int a[MAX_N];
int l[MAX_N];
bool cnt[MAX_M];

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%d", &a[i]);
		
	for (int i = 0; i < n; i++)
		x ^= a[i];
		
	for (int i = 0; i < n; i++) {
		l[i] = __builtin_ctz(a[i]);
		cnt[l[i]]++;
	}
		
	
	for (int i = 31; ~i; i--)
		if (((x >> i) & 1) ^ p) {
			if (!cnt[i]) {
				printf("-1");
				return 0;
			}
			
			p = !p;
			cnt[i]--;
			ans++;
		}

	printf("%d", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   20 |                 cnt[l[i]]++;
      |                 ~~~~~~~~^
a.cc:32:30: error: use of an operand of type 'bool' in 'operator--' is forbidden
   32 |                         cnt[i]--;
      |                         ~~~~~^
Language: C++

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

const long long MAX_N = 1e5 + 5;
long long n, x, ans;
long long a[MAX_N];
long long l[MAX_N];
long long cnt[MAX_N];

long long main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n;
	for (long long i = 0; i < n; i++)
		cin >> a[i];
		
	for (long long i = 0; i < n; i++)
		x ^= a[i];
		
	for (long long i = 0; i < n; i++) {
		l[i] = __builtin_ctz(a[i]);
		cnt[l[i]]++;
	}
		
	
	for (long long i = 20; ~i; i--)
		if ((x >> i) & 1) {
			if (!cnt[i]) {
				cout << "-1\n";
				return 0;
			}
			
			cnt[i]--;
			x = ~x;
			ans++;
		}

	cout << ans << "\n";
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxN = 1e3 + 13;
int n, ans, x;
bool mark[maxN];
vector<int> vec;
int main () {
    cin >> n;
    for (int i = 0; i < n; i++) {
	int a;
	cin >> a;
	x ^= a;
	a = __builtin_ctz(a);
	mark[a] = 1;
    }

    while (x) {
	vec.push_back(x % 2);
	x /= 2;
    }
    int indx = vec.size() - 1;
    int lst = 0;
    while (vec.size()) {
	int u = vec.back();
	vec.pop_back();
	if (u != lst) {
	    if (!mark[indx])
		return cout << -1 << endl, 0;
	    else
		ans++;
	}
	indx--;
	lst = u;
    }
    cout << ans << endl;
}

    
#include<bits/stdc++.h>
using namespace std;
const int maxN = 1e3 + 13;
int n, ans, x;
bool mark[maxN];
vector<int> vec;
int main () {
    cin >> n;
    for (int i = 0; i < n; i++) {
	int a;
	cin >> a;
	x ^= a;
	a = __builtin_ctz(a);
	mark[a] = 1;
    }

    while (x) {
	vec.push_back(x % 2);
	x /= 2;
    }
    int indx = vec.size() - 1;
    int lst = 0;
    while (vec.size()) {
	int u = vec.back();
	vec.pop_back();
	if (u != lst) {
	    if (!mark[indx])
		return cout << -1 << endl, 0;
	    else
		ans++;
	}
	indx--;
	lst = u;
    }
    cout << ans << endl;
}

    


Compiler output:
a.cc:41:11: error: redefinition of 'const int maxN'
   41 | const int maxN = 1e3 + 13;
      |           ^~~~
a.cc:3:11: note: 'const int maxN' previously defined here
    3 | const int maxN = 1e3 + 13;
      |           ^~~~
a.cc:42:5: error: redefinition of 'int n'
   42 | int n, ans, x;
      |     ^
a.cc:4:5: note: 'int n' previously declared here
    4 | int n, ans, x;
      |     ^
a.cc:42:8: error: redefinition of 'int ans'
   42 | int n, ans, x;
      |        ^~~
a.cc:4:8: note: 'int ans' previously declared here
    4 | int n, ans, x;
      |        ^~~
a.cc:42:13: error: redefinition of 'int x'
   42 | int n, ans, x;
      |             ^
a.cc:4:13: note: 'int x' previously declared here
    4 | int n, ans, x;
      |             ^
a.cc:43:6: error: redefinition of 'bool mark [1013]'
   43 | bool mark[maxN];
      |      ^~~~
a.cc:5:6: note: 'bool mark [1013]' previously declared here
    5 | bool mark[maxN];
      |      ^~~~
a.cc:44:13: error: redefinition of 'std::vector<int> vec'
   44 | vector<int> vec;
      |             ^~~
a.cc:6:13: note: 'std::vector<int> vec' previously declared here
    6 | vector<int> vec;
      |             ^~~
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main () {
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main () {
      |     ^~~~
Language: C++

#include <cstdio>

int check[30];

int main() {

  for (int bit = 29; bit >= 0; bit--) {
    check[bit] = 0;
  }

  int n;
  scanf("%d", &n);
  int xor_sum = 0;
  int a;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    xor_sum ^= a;
    a = a ^ (a - 1);

    switch (a) {
    case 1073741823:
      check[29] = 1;
      break;
    case 536870911:
      check[28] = 1;
      break;
    case 268435455:
      check[27] = 1;
      break;
    case 134217727:
      check[26] = 1;
      break;
    case 67108863:
      check[25] = 1;
      break;
    case 33554431:
      check[24] = 1;
      break;
    case 16777215:
      check[23] = 1;
      break;
    case 8388607:
      check[22] = 1;
      break;
    case 4194303:
      check[21] = 1;
      break;
    case 2097151:
      check[20] = 1;
      break;
    case 1048575:
      check[19] = 1;
      break;
    case 524287:
      check[18] = 1;
      break;
    case 262143:
      check[17] = 1;
      break;
    case 131071:
      check[16] = 1;
      break;
    case 65535:
      check[15] = 1;
      break;
    case 32767:
      check[14] = 1;
      break;
    case 16383:
      check[13] = 1;
      break;
    case 8191:
      check[12] = 1;
      break;
    case 4095:
      check[11] = 1;
      break;
    case 2047:
      check[10] = 1;
      break;
    case 1023:
      check[9] = 1;
      break;
    case 511:
      check[8] = 1;
      break;
    case 255:
      check[7] = 1;
      break;
    case 127:
      check[6] = 1;
      break;
    case 63:
      check[5] = 1;
      break;
    case 31:
      check[4] = 1;
      break;
    case 15:
      check[3] = 1;
      break;
    case 7:
      check[2] = 1;
      break;
    case 3:
      check[1] = 1;
      break;
    case 1:
      check[0] = 1;
      break;
    }
  }
  return;

  int ans = 0;
  for (int bit = 29; bit >= 0; bit--) {
    if (((1 << bit) & xor_sum) == 0) {
      continue;
    }
    int x = (1 << (bit + 1)) - 1;

    if (check[bit] > 0) {
      xor_sum ^= x;
      ans += 1;
    }
  }

  if (xor_sum != 0) {
    printf("-1\n");
  } else {
    printf("%d\n", ans);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:113:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
  113 |   return;
      |   ^~~~~~
Language: C

#include <cstdio>
#include <unordered_set>

int a[100000];

int main() {
  int n;
  scanf("%d", &n);
  int xor_sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    xor_sum ^= a[i];
  }

  std::unordered_set<int> s;
  for (int i = 0; i < n; i++)
    s.insert(a[i] ^ (a[i] - 1));
  int ans = 0;
  for (int bit = 29; bit >= 0; bit--) {
    if (((1 << bit) & xor_sum) == 0) {
      continue;
    }
    int x = (1 << (bit + 1)) - 1;

    if (s.find(x) != s.end()) {
      xor_sum ^= x;
      ans += 1;
    }
  }

  if (xor_sum != 0) {
    printf("-1\n");
  } else {
    printf("%d\n", ans);
  }
}

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

int check[30];
int main() {
  int n;
  scanf("%d", &n);

  for (int i = 0; i < 30; i++)
    check[i] = 0;

  int xor_sum = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    switch (x) {
    case 1:
      check[0] = 1;
      break;
    case 3:
      check[1] = 1;
      break;
    case 7:
      check[2] = 1;
      break;
    case 15:
      check[3] = 1;
      break;
    case 31:
      check[4] = 1;
      break;
    case 63:
      check[5] = 1;
      break;
    case 127:
      check[6] = 1;
      break;
    case 255:
      check[7] = 1;
      break;
    case 511:
      check[8] = 1;
      break;
    case 1023:
      check[9] = 1;
      break;
    case 2047:
      check[10] = 1;
      break;
    case 4095:
      check[11] = 1;
      break;
    case 8191:
      check[12] = 1;
      break;
    case 16383:
      check[13] = 1;
      break;
    case 32767:
      check[14] = 1;
      break;
    case 65535:
      check[15] = 1;
      break;
    case 131071:
      check[16] = 1;
      break;
    case 262143:
      check[17] = 1;
      break;
    case 524287:
      check[18] = 1;
      break;
    case 1048575:
      check[19] = 1;
      break;
    case 2097151:
      check[20] = 1;
      break;
    case 4194303:
      check[21] = 1;
      break;
    case 8388607:
      check[22] = 1;
      break;
    case 16777215:
      check[23] = 1;
      break;
    case 33554431:
      check[24] = 1;
      break;
    case 67108863:
      check[25] = 1;
      break;
    case 134217727:
      check[26] = 1;
      break;
    case 268435455:
      check[27] = 1;
      break;
    case 536870911:
      check[28] = 1;
      break;
    case 1073741823:
      check[29] = 1;
      break;
    default:
      break;
    }
    xor_sum ^= x;
  }

  int ans = 0;
  for (int bit = 29; bit >= 0; bit--) {
    if (((1 << bit) & xor_sum) == 0) {
      continue;
    }
    int x = (1 << (bit + 1)) - 1;

    if (check[bit]) {
      xor_sum ^= x;
      ans += 1;
    }
  }

  if (xor_sum != 0) {
    printf("-1\n");
  } else {
    printf("%d\n", ans);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'scanf' was not declared in this scope
    4 |   scanf("%d", &n);
      |   ^~~~~
a.cc:124:5: error: 'printf' was not declared in this scope
  124 |     printf("-1\n");
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int check[30];
a.cc:126:5: error: 'printf' was not declared in this scope
  126 |     printf("%d\n", ans);
      |     ^~~~~~
a.cc:126:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

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

int main() {
  vector<double> p(6);
  vector<double> q(6);
  for(int i=0;i<6;i++){
    cin>>p.at(i);
  }
  for(int i=0;i<6;i++){
    cin>>q.at(i);
  }
  double ans=0;
  double ANS=0;
  for(iny64_t X=0;X<1000000;X++){
    double x=X/1000000;
    ans+=max(x*p.at(0)/100,(1-x)*q.at(0)/100);
    ans+=max(x*p.at(1)/100,(1-x)*q.at(1)/100);
    ans+=max(x*p.at(2)/100,(1-x)*q.at(2)/100);
    ans+=max(x*p.at(3)/100,(1-x)*q.at(3)/100);
    ans+=max(x*p.at(4)/100,(1-x)*q.at(4)/100);
    ans+=max(x*p.at(5)/100,(1-x)*q.at(5)/100);
    if(x=0){
      ANS=ans;
    }
    ANS=min(ANS,ans);
    ans=0;
  }
   cout << fixed << setprecision(20);
  cout<<ANS<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'iny64_t' was not declared in this scope; did you mean 'int64_t'?
   15 |   for(iny64_t X=0;X<1000000;X++){
      |       ^~~~~~~
      |       int64_t
a.cc:15:19: error: 'X' was not declared in this scope
   15 |   for(iny64_t X=0;X<1000000;X++){
      |                   ^
Language: C++

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

long double p[10], q[10], sum, r, s; vector<pair<long double, long double>> A, B;

int main() {
	for (int i = 1; i <= 6; i++) { cin >> p[i]; p[i] /= 100; }
	for (int i = 1; i <= 6; i++) { cin >> q[i]; q[i] /= 100; }
	for (int i = 1; i <= 6; i++) {
		if (fabs(p[i] - q[i]) < 0.001) {
			A.push_back(make_pair(0, p[i] + q[i]));
			s += q[i];
		}
		else if (p[i] > q[i]) {
			A.push_back(make_pair(p[i] - q[i], p[i] + q[i]));
			s += q[i];
		}
		else {
			B.push_back(make_pair(q[i] - p[i], p[i] + q[i]));
			r += p[i];
		}
	}
	sum = r + s; sort(A.begin(), A.end()); sort(B.begin(), B.end());
	if (r < s) {
		long double S = s - r;
		for (int i = 0; i < A.size(); i++) {
			long double E = A[i].second;
			if (E > S) { sum += A[i].first*S / E; break; }
			else { S -= A[i].second; sum += A[i].first; }
		}
	}
	else {
		long double S = r - s;
		for (int i = 0; i < B.size(); i++) {
			long double E = B[i].second;
			if (E > S) { sum += B[i].first*S / E; break; }
			else { S -= B[i].second; sum += B[i].first; }
		}
	}
	printf("%.20Lf\n", 1.0L - sum / 2);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   12 |                 if (fabs(p[i] - q[i]) < 0.001) {
      |                     ^~~~
      |                     labs
Language: C++

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

long double p[100], q[100]; int bit[6];

pair<long double, long double> tourist(int v) {
	if (bit[v - 1] == 0) {
		if (fabs(p[v] - q[v]) < 0.000001)return make_pair(0.5, 0.5);
		if (p[v] > q[v])return make_pair(1, 0);
		return make_pair(0, 1);
	}
	return make_pair(p[v] / (p[v] + q[v]), q[v] / (p[v] + q[v]));
}
long double solve(long double P) {
	long double sum = 0;
	for (int i = 1; i <= 6; i++) {
		pair<long double, long double> A = tourist(i);
		sum += A.first*P*p[i];
		sum += A.second*(1.0L - P)*q[i];
	}
	return sum;
}
long double solve() {
	long double L = 0, R = 1, c1, c2, maxn = 1;
	for (int i = 0; i < 100; i++) {
		c1 = (L + L + R) / 3;
		c2 = (L + R + R) / 3;
		long double d1 = solve(c1), d2 = solve(c2);
		if (d1 < d2) { maxn = d1; R = c2; }
		else { maxn = d2; L = c1; }
	}
	return maxn;
}
int main() {
	for (int i = 1; i <= 6; i++) { cin >> p[i]; p[i] /= 100; }
	for (int i = 1; i <= 6; i++) { cin >> q[i]; q[i] /= 100; }
	long double ans = 0;
	for (int i = 0; i < 64; i++) {
		for (int j = 0; j < 6; j++)bit[j] = (i / (1 << j)) % 2;
		ans = max(ans, solve());
	}
	printf("%.20Lf\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'std::pair<long double, long double> tourist(int)':
a.cc:9:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    9 |                 if (fabs(p[v] - q[v]) < 0.000001)return make_pair(0.5, 0.5);
      |                     ^~~~
      |                     labs
Language: C++

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
in p2(in a){
  return 1LL<<a;
}
struct unifnd{
  VI ht,pr;
  in fnd(in a){
    in ta=a;
    while(a!=pr[a])a=pr[a];
    in tt=ta;
    while(ta!=a){
      tt=pr[ta];
      pr[ta]=a;
      ta=tt;
    }
    return a;
  }
  void uni(in a, in b){
    a=fnd(a);
    b=fnd(b);
    if(a==b)return;
    if(ht[b]<ht[a])swap(a,b);
    pr[a]=b;
    ht[b]+=(ht[a]==ht[b]);
  }
  void ini(in n){
    ht.resize(n);
    pr.resize(n);
    forn(i,n){
      ht[i]=0;
      pr[i]=i;
    }
  }
};
unifnd tfd;
vector<double> x,y,a;
vector<double> bspan;
vector<pair<double,pair<in,in> > > egs;
double sq(double d){
  return d*d;
}
double dist(in i, in j){
  return sqrt(sq(x[i]-x[j])+sq(y[i]-y[j]));
}
vector<double> btot;
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  in n;
  cin>>n;
  x=y=a=vector<double>(n);
  forn(i,n){
    cin>>x[i]>>y[i]>>a[i];
  }
  forn(i,n){
    forn(j,i){
      egs.PB(MP(dist(i,j),MP(i,j)));
    }
  }
  sort(all(egs));
  bspan.resize(p2(n));
  bspan[0]=2e9;
  in ta,tb;
  forn(msk,p2(n)){
    if(!msk)
      continue;
    double tsm=0;
    in tcnt=0;
    tfd.ini(n);
    forn(i,n){
      if(msk&p2(i)){
	tsm+=a[i];
	++tcnt;
      }
    }
    for(auto& eg:egs){
      ta=eg.second.first;
      tb=eg.second.second;
      if((msk&p2(ta))&&(msk&p2(tb))){
	if(tfd.fnd(ta)!=tfd.fnd(tb)){
	  tfd.uni(ta,tb);
	  tsm-=eg.first;
	}
      }
    }
    bspan[msk]=max(0.0,tsm/tcnt);
  }
  btot.resize(p2(n));
  btot[0]=2e9;
  forn(msk,p2(n)){
    if(!msk)
      continue;
    for(in lmsk=msk;lmsk>0;lmsk=(lmsk-1)&msk){
      btot[msk]=max(btot[msk],min(btot[msk^lmsk],bspan[lmsk]));
    }
  }
  cout<<setprecision(15);
  cout<<btot[p2(n)-1]<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'double dist(in, in)':
a.cc:61:10: error: 'sqrt' was not declared in this scope; did you mean 'sq'?
   61 |   return sqrt(sq(x[i]-x[j])+sq(y[i]-y[j]));
      |          ^~~~
      |          sq
Language: C++

#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>

#define mp make_pair
#define pb push_back


typedef long long ll;
typedef long double ld;

using namespace std;


vector<pair<ll, ll> > vv;
const ll INF = 9
e18;

int n;
ll dp[2][5100];
ll dp2[2][5100];

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		int l, r;
		scanf("%d%d", &l, &r);
		vv.push_back(make_pair(l + r, l));
	}
	sort(vv.begin(), vv.end());
	reverse(vv.begin(), vv.end());
	for (int i = 0; i <= n; ++i)
		dp[0][i] = dp[1][i] = INF;
	dp[0][0] = 0;
	for (int i = 0; i < (int)vv.size(); ++i) {
		for (int j = 0; j <= n; ++j)
			dp2[0][j] = dp2[1][j] = INF;
		for (int j = 0; j <= i; ++j) {
			dp2[0][j + 1] = min(dp2[0][j + 1], dp[0][j] + vv[i].first * j + (vv[i].first - vv[i].second));
			dp2[0][j] = min(dp2[0][j], dp[0][j] + vv[i].first * (i - j) + (vv[i].second));
		}
		if (n % 2 == 0) {
			for (int j = 0; j <= n; ++j) {
				dp[0][j] = dp2[0][j], dp[1][j] = dp2[1][j];
			}
			continue;
		}
		for (int j = 0; j <= i; ++j) {
			dp2[1][j + 1] = min(dp2[1][j + 1], dp[1][j] + vv[i].first * j + (vv[i].first - vv[i].second));
			dp2[1][j] = min(dp2[1][j], dp[1][j] + vv[i].first * (i - j) + (vv[i].second));
			dp2[1][j] = min(dp2[1][j], dp2[0][j] + ((n - 1) / 2) * vv[i].first);
		}
		for (int j = 0; j <= n; ++j) {
			dp[0][j] = dp2[0][j], dp[1][j] = dp2[1][j];
		}
	}
	if (n % 2 == 0) {
		cout << dp[0][n / 2] << "\n";
	}
	else {
		cout << dp[1][n / 2] << "\n";
	}
	return 0;
}




Compiler output:
a.cc:27:1: error: expected ',' or ';' before 'e18'
   27 | e18;
      | ^~~
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <random>
#include <vector>
#include <array>
#include <bitset>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>

using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
int bsr(int x) { return 31 - __builtin_clz(x); }

const int MN = 5050;
using P = pair<ll, ll>;
int n;
vector<P> v;

ll dp[MN][MN];
bool used[MN][MN];
ll calc(int m, int a) {
    if (m == 0) return 0;
    int b = n/2 - ((n-m)-(n/2-a));
    if (used[m][a]) return dp[m][a];
    used[m][a] = true;
    ll &ans = dp[m][a];
    ans = TEN(18);
    P p = v[m-1];
    // left
    if (a) {
        ll x = p.first*(a-1);
        x += p.second*(a);
        ans = min(ans, x + calc(m-1, a-1));
    }
    // right
    if (b) {
        ll x = p.first*(b);
        x += p.second*(b-1);
        ans = min(ans, x + calc(m-1, a));
    }
    return ans;
}

ll main2() {
    memset(used, false, sizeof(used));
    ll ans = 0;
    if (n % 2 == 1) {
        // 演算子の優先順位には…気をつけようね！ 
        ans += (v[n-1].first+v[n-1].second)*(n/2);
        n--;
    }
    return ans + calc(n, n/2);
}

int main() {
    ios::sync_with_stdio(0);
    cout << setprecision(20);
    int nn;
    cin >> nn;
    n = nn;
    for (int i = 0; i < n; i++) {
        ll l, r;
        cin >> l >> r;
        v.push_back(P(l, r));
    }
    ll ans = TEN(18);
    sort(v.begin(), v.end(), [&](const P l, const P r){
        ll ls = l.first+l.second;
        ll rs = r.first+r.second;
        if (ls != rs) return ls > rs;
        return l.first > r.first;
    });
    ans = min(ans, main2());
    n = nn;
    sort(v.begin(), v.end(), [&](const P l, const P r){
        ll ls = l.first+l.second;
        ll rs = r.first+r.second;
        if (ls != rs) return ls > rs;
        return l.second > r.second;
    });

    ans = min(ans, main2());

    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'll main2()':
a.cc:54:5: error: 'memset' was not declared in this scope
   54 |     memset(used, false, sizeof(used));
      |     ^~~~~~
a.cc:16:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   15 | #include <unordered_map>
  +++ |+#include <cstring>
   16 |
Language: C++

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

long long K, dp[555]; string S;

int main() {
	cin >> K;
	for (int i = 0; i <= 550; i++) {
		unsigned long long R = 1;
		for (int j = i + 1; j <= i + 7; j++) R *= j;
		R /= 5040;
		dp[i] = R;
	}
	for (int i = 549; i >= 0; i--) {
		while (K >= dp[i]) { S += "L"; K -= dp[i]; }
		S += "AVITSEF";
	}
	reverse(S.begin(), S.end());
	cout << S << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'reverse' was not declared in this scope
   19 |         reverse(S.begin(), S.end());
      |         ^~~~~~~
Language: C++

e polygon is simple (see notes for the definition).
Each edge of the polygon is parallel to one of the coordinate axes.
Each coordinate is an integer between 0 and 10^9, inclusive.
The vertices are numbered 1 through N in counter-clockwise order.
The internal angle at the i-th vertex is exactly a_i degrees.


Compiler output:
a.cc:1:1: error: 'e' does not name a type
    1 | e polygon is simple (see notes for the definition).
      | ^
Language: C

#include <iostream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <unordered_set>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdint>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>

#define rep(i, n) for(ll (i) = 0;(i) < (n);(i)++)
#define mp(a, b) make_pair((a),(b))
#define bs(n) ((ull)1<<(ull)n)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

constexpr ll inf = INT64_MAX / 4;
constexpr double pi = asin(1) * 2;
constexpr ll mod = 1000000007;
constexpr double eps = 0.000000001;

ll dp[100001];

ll fac(ll n) {
    if (n == 0)return 1;
    if (dp[n] == 0)dp[n] = (fac(n - 1) * n) % mod;
    return dp[n];
}

int main() {
    ll n;
    cin >> n;
    auto a = new pair<ll, ll>[n * 2];
    rep(i, n * 2) {
        cin >> a[i].first;
        a[i].second = (i < n ? -1 : 1);
    }
    sort(a, a + (n * 2));
    list<ll> v;
    ll c = 0, p = 0;
    rep(i, n * 2) {
        if (p != 0 && (a[i].second > 0 ^ p > 0)) {
            c++;
        } else if (c) {
            v.push_back(c);
            c = 0;
        }
        p += a[i].second;
    }
    if (c) v.push_back(c);
    ll r = 1;
    for (auto &e:v) r = (r *fac(e)) % mod;
    cout << r << endl;
}


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

#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const ll MOD = 1000000007;

int main()
{
    int n;
    cin >> n;
    int a[100002], b[100002];
    P p[200002];
    for(int i = 0; i < n; i++){
        cin >> a[i];
        p[i] = P(a[i], 0);
    }
    for(int i = 0; i < n; i++){
        cin >> b[i];
        p[n + i] = P(b[i], 1);
    }
    sort(p, p + n * 2);
    ll r = 0;
    ll ans = 1;
    for(int i = 0; i < n * 2; i++){
        if(p[i].second == 0){
            if(r < 0) ans = ans * -r % MOD;
            r++;
        }
        else{
            if(r > 0) ans = ans * r % MOD;
            r--;
        }
    }
    cout << ans << endl;
}

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

#include <iostream>
#include <utility>
#include <vector>
#include <algorithm>
#define llint long long
#define mod 1000000007

using namespace std;

llint n;
vector<pair<llint, llint> > vec;

int main(void)
{
  cin >> n;
  llint x;
  for(int i = 1; i <= n; i++){
    cin >> x;
    vec.push_back(make_pair(x, 1));
  }
   for(int i = 1; i <= n; i++){
    cin >> x;
    vec.push_back(make_pair(x, 2));
  }
  sort(vec.begin(), vec.end());
  
  llint cnt = 0, cnt2 = 0, ans = 0;
  for(int i = 0; i < vec.size(); i++){
    if(vec[i].second == 1){
      if(cnt2 == 0) cnt1++;
      else ans *= cnt2, ans %= mod, cnt2--;
    }
    else{
      if(cnt1 == 0) cnt2++;
      else ans *= cnt1, ans %= mod, cnt1--;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: 'cnt1' was not declared in this scope; did you mean 'cnt2'?
   30 |       if(cnt2 == 0) cnt1++;
      |                     ^~~~
      |                     cnt2
a.cc:34:10: error: 'cnt1' was not declared in this scope; did you mean 'cnt2'?
   34 |       if(cnt1 == 0) cnt2++;
      |          ^~~~
      |          cnt2
Language: C++

$N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print

Compiler output:
a.cc:1:8: error: stray '\' in program
    1 | $N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print
      |        ^
a.cc:1:14: error: stray '\' in program
    1 | $N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print
      |              ^
a.cc:1:63: error: stray '`' in program
    1 | $N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print
      |                                                               ^
a.cc:1:76: error: stray '`' in program
    1 | $N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print
      |                                                                            ^
a.cc:1:1: error: '$N' does not name a type
    1 | $N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print
      | ^~
a.cc:1:7: error: '$' does not name a type
    1 | $N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print
      |       ^
a.cc:1:14: error: expected ')' before '*=' token
    1 | $N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print
      |            ~ ^~~
      |              )
a.cc:1:78: error: 'print' does not name a type; did you mean 'int'?
    1 | $N=<>;$\=1;($\*=($p=$%)<($%=abs($c+=$_>$N||-1))||$p)%=1e9+7for`nl|sort -nk2`;print
      |                                                                              ^~~~~
      |                                                                              int
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
 
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 (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()

const int mod=1000000007;

int main(){
    int n;cin>>n;
    int a[n],b[n];
    vector<P> x(2*n);
    rep(i,n){
        int a;cin>>a;
        x[i]=P(a,1);
    }
    rep(i,n){
        int b;cin>>b;
        x[i+n]=P(b,2);
    }
    sort(all(x));
    int ctr=0;
    ll ans=1;
    int now=0;
    rep(i,2*n){
        if(x[i].second==1)ctr++;
        else ctr--;
        if(ctr==0){
            int pw=0;
            for(int j=i;j>=now;--j){
                if(x[j].second==2)pw++;
                else{
                        ans*=pw;ans%=mod;
                    }
                    pw--;
                }
            }
            now=i+1;
        }
    }
    cout<<ans<<endl;
}



Compiler output:
a.cc:48:5: error: 'cout' does not name a type
   48 |     cout<<ans<<endl;
      |     ^~~~
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = int(A); I < int(B); ++I)
const ll MOD=1e9+7;
int main(){
	ll N,ans=1,a;
	cin >> N;
	priority_queue<P> Q;
	FOR(i,0,N)cin>>a,Q.push({-a,-1});
	FOR(i,0,N)cin>>a,Q.push({-a,1});
	a = 0;
	while(!Q.empty()){
		if(a != Q.top().second*llabs(a))
			(ans *= llabs(a) )%=MOD;
		a+=Q.top().second;
		Q.pop();
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'P' was not declared in this scope
    9 |         priority_queue<P> Q;
      |                        ^
a.cc:9:25: error: template argument 1 is invalid
    9 |         priority_queue<P> Q;
      |                         ^
a.cc:9:25: error: template argument 2 is invalid
a.cc:9:25: error: template argument 3 is invalid
a.cc:10:28: error: request for member 'push' in 'Q', which is of non-class type 'int'
   10 |         FOR(i,0,N)cin>>a,Q.push({-a,-1});
      |                            ^~~~
a.cc:11:28: error: request for member 'push' in 'Q', which is of non-class type 'int'
   11 |         FOR(i,0,N)cin>>a,Q.push({-a,1});
      |                            ^~~~
a.cc:13:18: error: request for member 'empty' in 'Q', which is of non-class type 'int'
   13 |         while(!Q.empty()){
      |                  ^~~~~
a.cc:14:27: error: request for member 'top' in 'Q', which is of non-class type 'int'
   14 |                 if(a != Q.top().second*llabs(a))
      |                           ^~~
a.cc:16:22: error: request for member 'top' in 'Q', which is of non-class type 'int'
   16 |                 a+=Q.top().second;
      |                      ^~~
a.cc:17:19: error: request for member 'pop' in 'Q', which is of non-class type 'int'
   17 |                 Q.pop();
      |                   ^~~
Language: C++

#include <bits/stdc++.h>
using LL = long long;
const LL MOD = 1e9+9;
using namespace std;

int main(){
    int N;cin >> N;
    vector<LL> pc,outlet;
    for(int a = 0;a < N;a++){
        LL b;cin >> b;
        pc.push_back(b);
    }
    for(int a = 0;a < N;a++){
        LL b;cin >> b;
        outlet.push_back(b);
    }
    vector<pair<int,int>> vec1,vec2;
    sort(pc.begin(),pc.end());
    sort(outlet.begin(),outlet.end());
    string flag;
    for(int a = 0;a < N;a++){
        if(pc.at(a) < outlet.at(a)){
            flag.push_back('L');
            vec1.push_back({pc.at(a),outlet.at(a)});
        }else{
            flag.push_back('R');
            vec2.push_back({pc.at(a),outlet.at(a)});
        }
    }
    LL ans1 = 1;
    LL ans2 = 1;
    for(int a = 0;a < vec1.size();a++){
        int ok = a;
        int ng = vec1.size();
        while(abs(ng - ok) > 1){
            int mid = (ok+ng)/2;
            if(vec1.at(mid).first < vec1.at(a).second){
                ok = mid;
            }else{
                ng = mid;
            }
        }
     //   cout<<ok<<endl;
        ans1 += (ok-a);
    }
    for(int a = vec2.size()-1;a >= 0;a--){
        int ok = a;
        int ng = -1;
        while(abs(ok-ng) > 1){
            int mid = (ok+ng)/2;
            if(vec2.at(mid).first > vec2.at(a).second){
                ok = mid;
        3
3
10
8
7
12
5    }else{
                ng = mid;
            }
        }
     //   cout<<ok<<endl;
        ans2 += abs(ok-a);
    }
    cout<<(ans1*ans2)%MOD<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:10: error: expected ';' before numeric constant
   53 |         3
      |          ^
      |          ;
   54 | 3
      | ~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<set>
#include<map>
#include<queue>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);++i)
#define rrep(i,n) for(int (i)=(n)-1;(i)>=0;--i)
#define rep1(i,n) for(int (i)=1;(i)<=(n);++i)
#define rrep1(i,n) for(int (i)=(n);(i)>=1;--i)
#define pb push_back
#define fr first
#define sc second
#define int long long
typedef int ss;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<long long,long long> LP;
typedef double db;
using namespace std;

ll N;
ll A[100000];
ll B[100000];
vector<ll> xs;
ll w[200000];
vector<ll> F;
ll mod = 1e+9 + 7;
ll jo[200001];

int extgcd(int a,int b,int& x,int& y){
  int d=a;
  if(b != 0){
    d = extgcd( b , a%b, y, x);
    y -= (a/b)*x;
  } else{
    x=1; y=0;
  }
  return d;
}

int mod_inverse(int a,int m){
  int x,y;
  extgcd(a,m,x,y);
  return (m+x%m) %m;
}

ll comb(ll n,ll r){
  return (((jo[n]*mod_inverse(jo[r],mod)) %mod) *mod_inverse(jo[n-r],mod))%mod;
}

ss main()
{
  cin>>N;
  jo[0]=jo[1]=1LL;
  rep1(i,2*N){
    jo[i]= (jo[i-1]*i) %mod;
  }
  rep(i,N){
    cin>>A[i];
    xs.pb(A[i]);
  }
  rep(i,N){
    cin>>B[i];
    xs.pb(B[i]);
  }
  sort(xs.begin(),xs.end());
  xs.erase( unique(xs.begin(),xs.end()) , xs.end() );
  rep(i,N){
    A[i] = lower_bound(xs.begin(),xs.end(),A[i]) - xs.begin();
    B[i] = lower_bound(xs.begin(),xs.end(),B[i]) - xs.begin();
    w[A[i]]=0;
    w[B[i]]=1;
  }
  ll cnt;
  for(int i = 0; i< 2*N ;i++){
    cnt = 1LL;
    while(i + 1 < 2*N && w[i] == w[i+1] ){
      i++;
      cnt++;
    }
    F.pb(cnt);
  }
  ll ans = 1LL;
  rep(i,F.size()-1){
    if( F[i] <= F[i+1] ){
      ans = (ans * jo[F[i]])%mod;
      F[i+1]-=F[i];
    }
    else{
      ans = (((ans * jo[F[i+1]])%mod)*comb(F[i],F[i+1]))%mod;
      F[i+2] += (F[i]-F[i+1]);
      F[i] = F[i+1] = 0;
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc:58:1: error: '::main' must return 'int'
   58 | ss main()
      | ^~
Language: C++

#include <iostream>
using namespace std;
#include <list>
#include <stack>
#define ll long long
//00p0d0dp0p0d

int main(){
    int n;
    cin >>n;
    int a[n];
    int b[n];
    list<int> vacant;
    int ans=0;
    ll codelen=9223372036854775807;
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    sort(a,a+n);
    for(int i=0;i<n;i++){
        cin >> b[i];
//        vacant.push_back(b[i]);
    }
    sort(b,b+n);
    int curlen=0;
    for(int i=0;i<n;i++){
        curlen+=abs(a[i]-b[i]);
    }
    ans=1;
    int another[n];
    for(int i=0;i<n-1; i++){
        int x=abs(a[i]-b[i])+abs(a[i+1]-b[i+1]);
        int y=abs(a[i]-b[i+1])+abs(a[i+1]-b[i]);
        if (x==y){
            ans*=2;
        }
    }
    cout <<ans<<endl;
//    cout <<ans<<endl;
    return 0;
}

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

#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
 
using namespace std;
typedef long long ll;
 
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<int> G[100005];
std::vector<P> tree[100010];
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
ll i,j,k,l,ii,jj;
ll n,m;
ll a[100005],b[100005];
bool x[200005];
ll num=0
ll ans=1;
bool flag=false;
 
int maint(){
  for(i=0;i<=1000000000;i++){
    ans+=i;
    ans%=mod;
  }
  cout<<ans<<endl;
    return 0;
    
}


Compiler output:
a.cc:33:1: error: expected ',' or ';' before 'll'
   33 | ll ans=1;
      | ^~
a.cc: In function 'int maint()':
a.cc:38:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |     ans+=i;
      |     ^~~
      |     abs
a.cc:41:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   41 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>

using namespace std;
typedef long long ll;


typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする

vector<int> G[100005];
std::vector<P> tree[100010];

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};

ll i,j,k,l,ii,jj;
ll n,m;
ll a[100005],b[100005];
bool x[200005];
ll num=0
ll ans=1;
bool flag=false;

int maint(){
  for(i=0;i<=1000000000;i++){
    ans+=i;
    ans%-mod;
  }
  cout<<ans<<endl;
    return 0;
    
}


Compiler output:
a.cc:33:1: error: expected ',' or ';' before 'll'
   33 | ll ans=1;
      | ^~
a.cc: In function 'int maint()':
a.cc:38:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |     ans+=i;
      |     ^~~
      |     abs
a.cc:41:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   41 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C

#include<stdio.h>
#include<stdlib.h>
int R=1,C=1,H[2000010],N[2000010];
//評価関数（いまはMAX）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]>N[H[b]]?1:0;
}
//挿入関数
void hin(int a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  int n,i,a,b=0,M=1e9;
  long long s=1,c=1;
  scanf("%d",&n);
  for(i=0;i<n*2;i++){
    scanf("%d",&a);
    hin(a);
  }
  for(i=0;i<n*2;i++){
    hout()<=n?(b++):(b--);//printf("%d\n",b);
    if(b)s=(s*abs(b))%M;
  }
  printf("%lld\n",s);
  return 0;
}
#include<stdio.h>
#include<stdlib.h>
int R=1,C=1,H[2000010],N[2000010];
//評価関数（いまはMAX）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]>N[H[b]]?1:0;
}
//挿入関数
void hin(int a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  int n,i,a,b=0,M=1e9+7;
  long long s=1;
  scanf("%d",&n);
  for(i=0;i<n*2;i++){
    scanf("%d",&a);
    hin(a);
  }
  for(i=0;i<n*2;i++){
    hout()<=n?(b++):(b--);//printf("%d\n",b);
    if(b)s=(s*abs(b))%M;
  }
  printf("%lld\n",s);
  return 0;
}


Compiler output:
main.c:40:5: error: redefinition of 'R'
   40 | int R=1,C=1,H[2000010],N[2000010];
      |     ^
main.c:3:5: note: previous definition of 'R' with type 'int'
    3 | int R=1,C=1,H[2000010],N[2000010];
      |     ^
main.c:40:9: error: redefinition of 'C'
   40 | int R=1,C=1,H[2000010],N[2000010];
      |         ^
main.c:3:9: note: previous definition of 'C' with type 'int'
    3 | int R=1,C=1,H[2000010],N[2000010];
      |         ^
main.c:42:5: error: redefinition of 'hyouka'
   42 | int hyouka(int a,int b){
      |     ^~~~~~
main.c:5:5: note: previous definition of 'hyouka' with type 'int(int,  int)'
    5 | int hyouka(int a,int b){
      |     ^~~~~~
main.c:48:6: error: redefinition of 'hin'
   48 | void hin(int a){
      |      ^~~
main.c:11:6: note: previous definition of 'hin' with type 'void(int)'
   11 | void hin(int a){
      |      ^~~
main.c:54:5: error: redefinition of 'hout'
   54 | int hout(){
      |     ^~~~
main.c:17:5: note: previous definition of 'hout' with type 'int()'
   17 | int hout(){
      |     ^~~~
main.c:60:5: error: redefinition of 'main'
   60 | int main(){
      |     ^~~~
main.c:23:5: note: previous definition of 'main' with type 'int()'
   23 | int main(){
      |     ^~~~