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

#include <bits/stdc++.h>

#define forn(i, s, f) for (int i = (s); i <= (f); ++i)
#define for1(i, s, f) for (int i = (s); i >= (f); --i)
#define pb push_back

using namespace std;

typedef long long ll;

ll a, b, r, k = -1, ans;

#define int long long

int bit(ll x, int i)
{
    return ((x >> i) & 1);
}

main()
{
    cin >> a >> b;
    if (a == b)
    {
        cout << 1;
        return 0;
    }
    forn (i, 1, 61)
    {
        if (bit(a, i) != bit(b, i))
            r = i;
    }
    forn (i, r + 1, 61)
    {
        a = (bit(a, i) ? (a ^ (1ll << i)) : a),
        b = (bit(b, i) ? (b ^ (1ll << i)) : b);
    }
    ans = (1ll << r) - a;
    forn (i, 0, 61)
    {
        if ((1ll << r) + (1ll << i) <= b)
            k = i;
        else
            break;
    }
    pair < int, int > X, Y;
    X = {(1ll << r), (1ll << r) + (1ll << (k + 1ll)) - 1ll};
    Y = {(1ll << r) + a, 2ll * (1ll << r) - 1};
    if (X.second < Y.first) ans += (X.second - X.first + 1x) + (Y.second - Y.first + 1);
    else ans += max(X.second, Y.second) - X.first + 1;
    cout << ans;
}


Compiler output:
a.cc:20:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:49:58: error: unable to find numeric literal operator 'operator""x'
   49 |     if (X.second < Y.first) ans += (X.second - X.first + 1x) + (Y.second - Y.first + 1);
      |                                                          ^~
Language: Java

import java.util.*;

public class HelloWorld{

     public static void main(String []args){
        Scanner in = new Scanner(System.in);
        System.out.println(Long.highestOneBit(3));
     }
}


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

#include "bits/stdc++.h"
using namespace std;
long long a , b;
long long k;
long long intersect(long long a , long long b , long long l , long long r){
    return max(0LL , min(r , b) - max(l , a) + 1LL);
}
long long getor(long long l , long long r){
    long long res = 0;
    for(int i = 0 ; i < 60 ; ++i){
        if((l | (1LL << i)) <= r){
            res |= 1LL << i;
        }
    }
    while(l <= r){
        ans |= l;
        l <<= 1;
    }
    return res;
}
int main(){
    cin >> a >> b;
    if(a == b){
        cout << 1 << endl;
    }
    for(int i = 60 ; i >= 0 ; --i){
        if(((a >> i) & 1) != ((b >> i) & 1)){
            k = 1LL << i;
            break;
        }
        a &= ~(1LL << i);
        b &= ~(1LL << i);
    }
    long long ans = 0;
    ans += k - a;
    long long r = getor(k , b);
    ans += (r - k + 1);
    ans += k - a;
    ans -= intersect(k + a , k + k - 1 , k , r);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'long long int getor(long long int, long long int)':
a.cc:16:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |         ans |= l;
      |         ^~~
      |         abs
Language: C++

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

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

ll A, B;

vi get(ll x)
{
	vi res;
	while (x > 0) {
		res.pb(x & 1);
		x /= 2;
	}
	return res;
}

vector<pair<ll, ll>> cand;

int main() {
	cin >> A >> B;

	if (A == B) {
		puts("1");
		return 0;
	}

	vi va = get(A);
	vi vb = get(B);

	while (va.size() < vb.size()) {
		va.pb(0);
	}

	ll com = 0;
	int lp = -1;

	int sz = va.size();
	for (int i = sz - 1; i >= 0; --i) {
		if (va[i] != vb[i]) {
			lp = i;
			break;
		}
		com += ((ll)va[i]LL << i);
	}

	sz = lp + 1;

	cand.eb(A - com, (1LL << lp) - 1);
	cand.eb(A - com + (1LL << lp), (1LL << (lp + 1)) - 1);

	int pz = -1;
	for (int i = sz - 2; i >= 0; --i) {
		if (vb[i]) {
			pz = i;
			break;
		}
	}

	ll lo = (1LL << lp);
	ll hi = (1LL << lp);

	if (pz != -1) {
		hi += (1LL << (pz + 1)) - 1;
	}

	cand.eb(lo, hi);

	sort(ALL(cand));
	ll ret = 0;
	ll la = -1, hd = -1;

	rep(i, cand.size()) {
		if (la == -1) {
			hd = cand[i].fi, la = cand[i].se;
		} else {
			if (la >= cand[i].fi) {
				la = max(cand[i].se, la);
			} else {
				ret += la - hd + 1;
				hd = cand[i].fi, la = cand[i].se;
			}
		}
	}

	ret += la - hd + 1;
	cout << ret << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:34: error: expected ')' before 'LL'
   55 |                 com += ((ll)va[i]LL << i);
      |                        ~         ^~
      |                                  )
Language: C++

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

int main()
{
    long long A,B,i,firstA,firstB,r,k;
    cin >> A >> B;
    bitset<60> bitA(A);
    bitset<60> bitB(B);
    cout << bitA << endl;
    cout << bitB << endl;
    r = -1;
    k= -1;
    for (i=59;i>=0;i--){
        if (bitA.test(i)!= bitB.test(i)){
            r = i;
            break;
        }else{
            bitA.reset(i);
            bitB.reset(i);
        }
    }
    A = bitA.to_ullong();
    B = bitB.to_ullong();

    if (r== -1){
        cout << 1 << endl;
    }else{
        for (i=r-1;i>=0;i--){
            if (bitB.test(i)){
                k = i;
                break;
            }
        }

        if (pow(2,k+1) >= A){
            cout << dec <<(long long)((1LL<<r+1) - A) << endl;
        }else{
            cout << dec << (2 * (long long)((1LL<<r) - A) + (1LL<<(k+1))) <<endl;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'bitset' was not declared in this scope
   12 |     bitset<60> bitA(A);
      |     ^~~~~~
a.cc:6:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    5 | #include <cmath>
  +++ |+#include <bitset>
    6 | using namespace std;
a.cc:12:16: error: 'bitA' was not declared in this scope
   12 |     bitset<60> bitA(A);
      |                ^~~~
a.cc:13:16: error: 'bitB' was not declared in this scope
   13 |     bitset<60> bitB(B);
      |                ^~~~
Language: C++

1. #include <bits/stdc++.h>
2. #define forn(i, n) for(int i = 0; i < (int)(n); i++)
3. typedef long long ll;
4. typedef unsigned long long ull;
5. typedef long double ld;
6. using namespace std;
7.  
8. ll get(ll x) {
9.     for(int i = 60; i >= 0; i--) {
10.         if((1LL << i) & x)
11.             return i;
12.     }
13. }
14.  
15. int main() {
16.     //ios_base::sync_with_stdio(false);
17.     //freopen("input.txt", "r", stdin);
18.     //freopen("output.txt", "w", stdout);
19.  
20.     ll a, b;
21.     cin >> a >> b;
22.     if(a == b) {
23.         cout << "1\n";
24.         return 0;
25.     }
26.     ll pos1 = get(a);
27.     ll pos2 = get(b);
28.     ull ans = 0;
29.     while(pos1 == pos2) {
30.         a ^= (1LL << pos1);
31.         b ^= (1LL << pos2);
32.         pos1 = get(a);
33.         pos2 = get(b);
34.     }
35.     ans += (1LL << pos2) - a + 1;
36.     ans += ((1LL << (pos1 + 1)) - 1) - a + 1;
37.     b ^= (1LL << pos2);
38.     ans += max(0LL, min(a - 1, (1LL << (get(b) + 1)) - 1));
39.     for(int i = max(get(b) + 1, pos1 + 1); i < pos2; i++) {
40.         ans += (1LL << i);
41.     }
42.     cout << ans << "\n";
43.     return 0;
44. }


Compiler output:
a.cc:1:4: error: stray '#' in program
    1 | 1. #include <bits/stdc++.h>
      |    ^
a.cc:2:4: error: stray '#' in program
    2 | 2. #define forn(i, n) for(int i = 0; i < (int)(n); i++)
      |    ^
a.cc:7:4: error: extended character   is not valid in an identifier
    7 | 7.  
      |    ^
a.cc:14:5: error: extended character   is not valid in an identifier
   14 | 14.  
      |     ^
a.cc:19:5: error: extended character   is not valid in an identifier
   19 | 19.  
      |     ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1. #include <bits/stdc++.h>
      | ^~
a.cc:2:38: error: 'i' does not name a type
    2 | 2. #define forn(i, n) for(int i = 0; i < (int)(n); i++)
      |                                      ^
a.cc:2:52: error: 'i' does not name a type
    2 | 2. #define forn(i, n) for(int i = 0; i < (int)(n); i++)
      |                                                    ^
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 4. typedef unsigned long long ull;
      | ^~
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 5. typedef long double ld;
      | ^~
a.cc:6:1: error: expected unqualified-id before numeric constant
    6 | 6. using namespace std;
      | ^~
a.cc:7:1: error: expected unqualified-id before numeric constant
    7 | 7.  
      | ^~
a.cc:14:1: error: expected unqualified-id before numeric constant
   14 | 14.  
      | ^~~
Language: C++

#import<iostream>
#define a(x) 1LL<<64-__builtin_clzll(x)
long long A,B,C,i;main(){std::cin>>A>>B;if(A^B){C=(a(A^B))-1;A&=C;B&=C;i=++C>>1;B=(B-i)?(a(B-i))-1:0;C=C-A-(A>B)*(A-1-B);std::cout<<C;}elseputs("1");}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<iostream>
      |  ^~~~~~
a.cc:3:19: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | long long A,B,C,i;main(){std::cin>>A>>B;if(A^B){C=(a(A^B))-1;A&=C;B&=C;i=++C>>1;B=(B-i)?(a(B-i))-1:0;C=C-A-(A>B)*(A-1-B);std::cout<<C;}elseputs("1");}
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:3:136: error: 'elseputs' was not declared in this scope
    3 | long long A,B,C,i;main(){std::cin>>A>>B;if(A^B){C=(a(A^B))-1;A&=C;B&=C;i=++C>>1;B=(B-i)?(a(B-i))-1:0;C=C-A-(A>B)*(A-1-B);std::cout<<C;}elseputs("1");}
      |                                                                                                                                        ^~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>
#include <cmath>

using namespace std;

void solve(unsigned long long a, unsigned long long b) {
    unsigned long long tmp = b;
    int counter = 0;
    int counter2 = 0;
    while (tmp == 0) {
        if (tmp/2 == 1) {
            counter2 += 1;
        }
        tmp /= 2;
        counter += 1;
    }
    unsigned long long maxa = poe(2, counter);
    unsigned long long x = maxa - a;
    x += b - a + 1;
    std::cout << x << std::endl;
}

int main() {
    struct timeval start,end;
    long long span;
    unsigned long long a b;

    gettimeofday(&start,NULL);

    std::cin >> a >> b;
    solve(a, b);

    gettimeofday(&end,NULL);
    span = (end.tv_sec -start.tv_sec)*1000000LL + (end.tv_usec - start.tv_usec);
    std::cerr << "--Total Time: " << span/1000 << "ms" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long unsigned int, long long unsigned int)':
a.cc:23:31: error: 'poe' was not declared in this scope; did you mean 'pow'?
   23 |     unsigned long long maxa = poe(2, counter);
      |                               ^~~
      |                               pow
a.cc: In function 'int main()':
a.cc:32:26: error: expected initializer before 'b'
   32 |     unsigned long long a b;
      |                          ^
a.cc:36:17: error: 'a' was not declared in this scope
   36 |     std::cin >> a >> b;
      |                 ^
a.cc:36:22: error: 'b' was not declared in this scope
   36 |     std::cin >> a >> b;
      |                      ^
Language: Java

import java.util.*;
public class sample {
	public static void main(String[] args) {
	
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());

		int res;

		if(b >= a){
			res = b -a;
			res = res + res /2;
			system.out.print(res);
		}


	}
}

Compiler output:
Main.java:2: error: class sample is public, should be declared in a file named sample.java
public class sample {
       ^
Main.java:14: error: package system does not exist
			system.out.print(res);
			      ^
2 errors
Language: Java

import java.util.*;
public class sample {
	public static void main(String[] args) {
	
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());

		int res

		if(b >= a){
			res = b -a;
			res = res + res /2;
			system.out.print(res);
		}


	}
}

Compiler output:
Main.java:9: error: ';' expected
		int res
		       ^
1 error
Language: C++

#include <cstdio>
#include <cstring>
#include <cctype>
#include <algorithm>
#include <vector>
using namespace std;
inline int read(int f = 1, int x = 0, char ch = ' ')
{
    while(!isdigit(ch = getchar())) if(ch == '-') f  = -1;
    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();
    return f*x;
}
const int N = 2e5+5, P = 1e9+7;
int n;
pair<int, int> p[N];
int f[N], s[N], t[N], _[N], ans;
vector<int> h[N];
int main()
{
    n = read();
    for(int i = 1; i <= n; ++i) 
    {
        int x = read(), v = read();
        p[i] = make_pair(x, v), _[i] = v;
    }
    sort(_+1, _+1+n), sort(p+1, p+1+n);
    for(int i = 1; i <= n; ++i) p[i].second = lower_bound(_+1, _+1+n, p[i].second)-_;    
    for(int i = n, f = p[n].second; i; --i) f = min(f, p[i].second), t[i] = f;
    for(int i = 1, f = 0; i <= n; ++i) f = max(f, p[i].second), h[f].push_back(t[i]); 
    f[0] = s[0] = 1;
    for(int i = 1; i <= n; ++i)
    {
        s[i] = s[i-1];
        for(int k = 0; k < h[i].size(); ++k)
        {
            int j = h[i][k];
            s[i] = ((s[i]+((s[i]-s[j-1]+P)%P+f[j-1]))%P)%P; 
        }
    }
    printf("%d\n", (s[n]-s[n-1]+P)%P);
    return 0;
}-

Compiler output:
a.cc:42:2: error: expected unqualified-id before '-' token
   42 | }-
      |  ^
Language: C++

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

#define MOD (1000000007)
const int N=5e5+10;
int h[N], l[N], r[N];
vector<int> L[N];
int x[N], v[N], a[N];
bool cmp(const int &a, const int &b) { return v[a]<v[b]; }
int f[N], S[N];

int main() {

    ios::sync_with_stdio(false), cin.tie(0);
    int n, m;
    cin>>n;
    for(int i=1; i<=n; i++) cin>>x[i]>>v[i], a[i]=i;
    sort(a+1, a+1+n, cmp);
    int stk[N], p[N], t=0;
    for(int i=1; i<=n; i++) {
        if(!t || stk[t]<x[a[i]]) stk[++t]=x[a[i]], p[t]=i;
        int l=1, r=t, mid;
        while(l<r) {
            mid=(l+r)>>1;
            if(stk[mid]<x[a[i]]) l=mid+1;
            else r=mid;
        }
        l[i]=p[r];
    }
    t=0;
    for(int i=n; i>=1; i--) {
        if(!t || stk[t]>x[a[i]]) stk[++t]=x[a[i]], p[t]=i;
        int l=1, r=t, mid;
        while(l<r) {
            mid=(l+r)>>1;  
            if(stk[mid]>x[a[i]]) l=mid+1;
            else r=mid;
        }
        r[i]=p[r];
    }

    for(int i=1; i<=n; i++) L[r[i]].push_back(l[i]);
    f[0]=S[0]=1;
    for(int i=1; i<=n; i++) {
        S[i]=S[i-1];
        sort(L[i].begin(), L[i].end());
        for(int j:L[i]) {
            f[i]=(1ll*f[i]+S[i]-(j-2>=0?S[j-2]:0)+MOD)%MOD;
            S[i]=(f[i]+S[i-1])%MOD;
        }
    }
    cout<<f[n]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:10: error: invalid types 'int[int]' for array subscript
   28 |         l[i]=p[r];
      |          ^
a.cc:39:10: error: invalid types 'int[int]' for array subscript
   39 |         r[i]=p[r];
      |          ^
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#define pr pair<int,int>

using namespace std;

const int mod = 1e9+7;
const int maxn = 200010;

int n = 0;
pr p[maxn];
int X[maxn], V[maxn];
int fa[maxn];

int getroot(int u) {
 	return fa[u] == u ? u : (fa[u]=getroot(fa[u]));   
}

void Union(int u, int v) {
    int ru = getroot(u), rv = getroot(v);
    if (ru != rv) fa[ru] = rv;
}

int Min(int i, int j) {
 	if (!i) return j;
    return V[i] < V[j] ? i : j;
}

int Max(int i, int j) {
 	if (!i) return j;
    return V[i] > V[j] ? i : j;
}

void solve(int l, int r) {
    if (l == r) return;
 	int m = (l + r) >> 1;
    solve(l, m);
    solve(m+1, r);
    int mx_L = 0, mn_R = 0;
    for (int i = l; i <= m; i++) mx_L = max(mx_L, V[i]);
    for (int i = m+1; i <= r; i++) mn_R = min(mn_R, v[i]);
    for (int i = l; i <= m; i++) if (V[i] > V[mn_R]) Union(i, mn_R); 
    for (int i = m+1; i <= r; i++) if (V[i] < V[mx_L]) Union(i, mx_L);
}

int qpow(int x, int y) {
 	int ret = 1;
    while (y) {
        if (y&1) {
         	ret = 1LL*ret*x%mod;   
        }
        x = 1LL*x*x%mod;
     	y >>= 1;   
    }
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
     	fa[i] = i;
    }
    for (int i = 1; i <= n; i++) {
     	scanf("%d%d", &X[i], &V[i]);
        p[i] = pr(X[i], V[i]);
    }
    sort(p+1, p+n+1);
    for (int i = 1; i <= n; i++) V[i] = p[i].second;
    solve(1, n);
 	sort(fa+1, fa+n+1);
    int c = 0;
    int ans = 1;
    for (int i = 1; i <= n+1; i++) {
     	if (fa[i] != fa[i-1]) {
            ans = 1LL*ans*(qpow(2, c)+mod-1)%mod;
            c = 1;
        } else c ++;
    }
    printf("%d\n", ans);
    return 0;
}

Compiler output:
a.cc: In function 'void solve(int, int)':
a.cc:43:53: error: 'v' was not declared in this scope
   43 |     for (int i = m+1; i <= r; i++) mn_R = min(mn_R, v[i]);
      |                                                     ^
a.cc: In function 'int qpow(int, int)':
a.cc:57:1: warning: no return statement in function returning non-void [-Wreturn-type]
   57 | }
      | ^
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define N 200050
#define mod 1000000007
ll f[N],s[N];
int n,V[N],L[N],R[N];
struct A {
	int x,v;
	bool operator < (const A &p) const {return x<p.x;}
}a[N];
int main() {
	scanf("%d",&n);
	int i,k=1;
	for(i=1;i<=n;i++) scanf("%d%d",&a[i].x,&a[i].v),V[i]=a[i].v;
	sort(V+1,V+n+1);
	for(i=1;i<=n;i++) a[i].v=lower_bound(V+1,V+n+1,a[i].v)-V;
	sort(a+1,a+n+1);
	for(R[0]=0,i=1;i<=n;i++) R[i]=max(R[i-1],a[i].v);
	for(L[n+1]=n+1,i=n;i;i--) L[i]=min(L[i+1],a[i].v);
	for(f[0]=s[0]=1,i=1;i<=n;i++) {
		int l=L[i],r=R[i];
		for(;k<=r;k++) s[k]=s[k-1];  
		if(l>1) f[r]=(f[r]+s[r]-s[l-2]+mod)%mod;
		else f[r]=(f[r]+s[r])%mod;
		s[r]=(s[r-1]+f[r])%mod;
	}
	printf("%lld\n",(f[n]%mod+mod)%mod);
}


Compiler output:
a.cc:8:1: error: 'll' does not name a type
    8 | ll f[N],s[N];
      | ^~
a.cc: In function 'int main()':
a.cc:23:13: error: 'f' was not declared in this scope
   23 |         for(f[0]=s[0]=1,i=1;i<=n;i++) {
      |             ^
a.cc:23:18: error: 's' was not declared in this scope
   23 |         for(f[0]=s[0]=1,i=1;i<=n;i++) {
      |                  ^
a.cc:30:26: error: 'f' was not declared in this scope
   30 |         printf("%lld\n",(f[n]%mod+mod)%mod);
      |                          ^
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define N 200050
#define mod 1000000007
int n,f[N],V[N],L[N],R[N],s[N];
struct A {
	int x,v;
	bool operator < (const A &p) constt {x<p.x;}
}a[N];
int main() {
	scanf("%d",&n);
	int i,k=1; s[0]=1;
	for(i=1;i<=n;i++) scanf("%d%d",&a[i].x,&a[i].v),V[i]=a[i].v;
	sort(V+1,V+n+1);
	for(i=1;i<=n;i++) a[i].v=lower_bound(V+1,V+n+1,a[i].v)-V;
	sort(a+1,a+n+1,cmp1);
	for(R[0]=0,i=1;i<=n;i++) R[i]=max(R[i-1],a[i].v);
	for(L[n+1]=n+1,i=n;i;i--) L[i]=min(L[i+1],a[i].v);
	for(i=1;i<=n;i++) {
		int l=L[i],r=R[i];
		for(;k<=r;k++) s[k]=s[k-1];  
		if(l>1) f[r]=(f[r]+s[r]-s[l-2]+mod)%mod;
		else f[r]=(f[r]+s[r])%mod;
		s[r]=(s[r-1]+f[r])%mod;
	}
	printf("%d\n",f[n]);
}


Compiler output:
a.cc:11:36: error: expected ';' at end of member declaration
   11 |         bool operator < (const A &p) constt {x<p.x;}
      |                                    ^
      |                                     ;
a.cc:11:38: error: 'constt' does not name a type; did you mean 'const'?
   11 |         bool operator < (const A &p) constt {x<p.x;}
      |                                      ^~~~~~
      |                                      const
a.cc: In function 'int main()':
a.cc:19:24: error: 'cmp1' was not declared in this scope
   19 |         sort(a+1,a+n+1,cmp1);
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>

const int N=2e5+10,Mod=1e9+7;

struct Node{
	int k,x,l,r;
	bool operator < ( const Node &A ) const { return (r<A.r) || ( r==A.r && l<A.l); }
}p[N];

bool cmpk( const Node &A , const Node &B ) { return A.k<B.k; }
bool cmpx( const Node &A , const Node &B ) { return A.x<B.x; }

int n,f[N],sum[N];

void Init() {
	scanf("%d",&n);
	for (int i=1;i<=n;++i) scanf("%d%d",&p[i].x,&p[i].k);
}

void Solve() {
	std::sort(p+1,p+n+1,cmpk); for (int i=1;i<=n;++i) p[i].k=i;
	std::sort(p+1,p+n+1,cmpx); for (int i=1;i<=n;++i) p[i].x=i;
	int mx=-Inf;
	for (int i=1;i<=n;++i) {
		mx=std::max(mx,p[i].k);
		p[i].r=mx;
	}
	int mn=Inf;
	for (int i=n;i>=1;--i) {
		mn=std::min(mn,p[i].k);
		p[i].l=mn;
	}
	std::sort(p+1,p+n+1);
	f[0]=1; sum[0]=1; int t=1; 
	for (int i=1;i<=n;++i) {
		while (p[t].r==i && t<=n) {
			f[i]=(1ll*f[i]+f[i]+sum[i-1]-sum[p[t].l-1]+f[p[t].l-1])%Mod;
			++t;
		}
		sum[i]=(sum[i-1]+f[i])%Mod;
	}
	printf("%d\n",f[n]);
}

int main() {
	Init();
	Solve();
	return 0;
}

Compiler output:
a.cc: In function 'void Solve()':
a.cc:23:17: error: 'Inf' was not declared in this scope; did you mean 'ynf'?
   23 |         int mx=-Inf;
      |                 ^~~
      |                 ynf
Language: C++

#include<bits/stdc++.h>
#define int long long
#define out(x) cerr << #x << " = " << x << "\n"
using namespace std;
typedef long long ll;
//by piano
template<typename tp> inline void read(tp &x) {
  x = 0;char c = getchar();bool f = 0;
  for(; c < '0' || c > '9'; f |= (c == '-'), c = getchar());
  for(; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if(f) x = -x;
}
const int N = 1e6 + 2333, inf = 1e16 + 233, mo = 1e9 + 7;
struct P {
  int x, v;
}p[N];
int n, v[N], a[N], M, L[N], R[N], b[N];
inline bool cmp_x(P a, P b) {return a.x < b.x;}
inline int Qmin(int s, int t, int ans = inf) {
  for(s += M - 1, t += M + 1; s ^ t ^ 1; s >>= 1, t >>= 1) {
    if(~s & 1) ans = min(ans, a[s ^ 1]);
    if(t & 1) ans = min(ans, a[t ^ 1]);
  }return ans;
}
inline int Qmax(int s, int t, int ans = 0) {
  for(s += M - 1, t += M + 1; s ^ t ^ 1; s >>= 1, t >>= 1) {
    if(~s & 1) ans = max(ans, b[s ^ 1]);
    if(t & 1) ans = max(ans, b[t ^ 1]);
  }return ans;
}
vector<int> vec[N];
int tr[N];
inline void U(int &x, int y) {for(x += y; tr[x] >= mo; tr[x] -= mo);}
inline void A(int u, int v) {for(; u <= n; u += u & -u) U(tr[u], v);}
inline int Q(int u, int ans = 0) {for(; u >= 1; u -= u & -u) U(ans, tr[u]); return ans;}									      
main() {
  read(n);
  for(int i = 1; i <= n; i ++)
    read(p[i].x), read(p[i].v);
  sort(p + 1, p + n + 1, cmp_x);
  for(int i = 1; i <= n; i ++)
    v[i] = p[i].v;
  sort(v + 1, v + n + 1);
  for(int i = 1; i <= n; i ++)
    p[i].v = lower_bound(v + 1, v + n + 1, p[i].v) - v;
  for(M = 1; M <= n + 1; M ++);
  memset(a, 38, sizeof(a));
  for(int i = 1; i <= n; i ++)
    a[i + M] = b[i + M] = p[i].v;
  for(int i = M; i; i --) {
    a[i] = min(a[i << 1], a[i << 1 | 1]);
    b[i] = max(b[i << 1], b[i << 1 | 1]);
  }
  for(int i = 1; i <= n; i ++) {
    L[i] = Qmin(i, n), R[i] = Qmax(1, i);
    vec[R[i]].push_back(L[i]);
    // cout << L[i] << " " << R[i] << " " << p[i].x << " " << p[i].v <<  "\n";
  }
  A(1, 1);
  for(int i = 1; i <= n; i ++) {
    for(vector<int> ::iterator it = vec[i].begin(); it != vec[i].end(); ++ it)
      A(i, (Q(i) - Q(*it - 1) + mo) % mo);
  }
cout << Q(n) - Q(n - 1);1
}


Compiler output:
a.cc:36:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   36 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:64:26: error: expected ';' before '}' token
   64 | cout << Q(n) - Q(n - 1);1
      |                          ^
      |                          ;
   65 | }
      | ~
Language: C++

#include <cstdio>
#include <queue>
#include <iostream>
#include <algorithm>
#define INT long long
#define oo 987654321
#define MOD 1000000007
using namespace std;

INT n, base, T[1<<19], ans, p[200020] = {1};
struct V{ INT x, v; } a[200020];
bool cmp(V a, V b)
{
    return a.x < b.x;
}
bool cmp2(V a, V b)
{
    return a.v < b.v;
}
INT getSum(int l, int r)
{
    INT sum = 0;
    while( l <= r )
    {
        if( l%2 == 1 ) sum+=T[l], l++;
        if( r%2 == 0 ) sum+=T[r], r--;
        l>>=1, r>>=1;
    }
    return sum;
}
int main()
{
    ios::sync_with_stdio(false);
    cin>>n;
    for(int i = 1 ; i <= n ; i++ ) p[i] = p[i-1]*2, p[i]%=MOD;
    for( base = 1 ; base < n ; base<<=1);
    for(int i = 0 ; i < n ; i++ ) cin>>a[i].x>>a[i].v;
    sort(a, a+n, cmp2);
    for(int i = 0 ; i < n ; i++ ) a[i].v = i;
    sort(a, a+n, cmp);
    for(int i = 0 ; i < n ; i++ )
    {
        ans += (INT)pow(2, getSum(base+a[i].v, base*2-1));
        ans %= MOD;
        T[base+a[i].v] = 1;
    }
    cout<<ans<<endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:43:21: error: 'pow' was not declared in this scope
   43 |         ans += (INT)pow(2, getSum(base+a[i].v, base*2-1));
      |                     ^~~
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <bits/stdc++.h>
#define debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long ll;
using namespace std;
typedef std::pair<ll, ll> mp;
#define fi first
#define se second
#define MOD 1000000007
inline ll read()
{
	ll x = 0, f = 1; char ch = getchar();
	while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }
	while (isdigit(ch)) { (x *= 10) += ch - '0'; ch = getchar(); }
	return x * f;
}

const int maxk = 100, mod = 1000000007;
ll fib[maxk], res; int mx;
std::vector<mp> excellent[maxk];

int main() {
	int k = 1;
	fib[0] = fib[1] = 1;
	ll lim = 1000000000000000000;
	while(fib[k] + fib[k - 1] <= lim) {
		++ k;
		fib[k] = fib[k - 1] + fib[k - 2];
	}

 exellent[1].push_back(mp(1, 2));
	for (int i = 2; i <= k; i++)
	{
		for (pair<ll, ll> p : exellent[i-1])
			exellent[i].push_back(mp(p.se, p.fi + p.se));
		exellent[i].push_back(mp(fib[i+1], fib[i+1] + fib[i-1]));
	}

 int T = read();
	while (T--)
	{
		ll x = read(), y = read(); mx = 1, res = 0;
		if (x > y) swap(x, y);
		while (mx+2 <= k && fib[mx+1] <= x && fib[mx+2] <= y) mx++;
		for (pair<ll, ll> p : excellent[mx])
		{
			if (p.fi <= x && p.se <= y)
				(res += (y - p.se) / p.fi + 1) %= MOD;
			if (p.se <= x)
				(res += (x - p.se) / p.fi + 1) %= MOD;
		}
		if (mx == 1) res += x;
		printf("%d %lld\n", mx, res);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:2: error: 'exellent' was not declared in this scope; did you mean 'excellent'?
   34 |  exellent[1].push_back(mp(1, 2));
      |  ^~~~~~~~
      |  excellent
Language: C++

#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define SZ(x) ((ll)(x).size())
#define pb push_back
template<class T = ll> using V = vector<T>;
template<class T = ll> using VV = V<V<T>>;

const int MOD = 1e9 + 7;

using P = pair<ll,ll>;
V<> fib(90, 1);
VV<P> worst(85);

void preparation(){
    for(int i = 2; i < 90; i++) fib[i] = fib[i-1] + fib[i-2];
    worst[0].pb({1, 2}); 
    REP(i, 84){
        REP(j, SZ(worst[i])){
            P p = worst[i][j];
            ll a = p.first, b = p.second, c = a + b;
            worst[i + 1].pb({b, c});
            if(!j) worst[i + 1].pb({c, b + 2 * a});
        }
    }
}

ll x, y;
void solve(){
    scanf("%lld%lld", &x, &y);
    if(x > y) swap(x, y);
    if(y <= 2){
		printf("1 %lld\n", x*y);
        return;
    }
    ll a = 0;
    while(fib[a + 1] <= x and fib[a + 2] <= y) a++;
    if(a == 1){
        printf("%d %lld\n", 1, (x%MOD*y)%MOD);
        return;
    }
    ll res = 0;
    for(auto &p : worst[a - 1]){
        if(p.first > x or p.second > y) continue;
        res++;
        res = (res + (y - p.second) / p.first) % MOD;
        if(p.second > x or p.first > y) continue;
        res++;
    }
    printf("%lld %lld\n", a, res%MOD);
}

int q;
int main(){
    ios;
    preparation();
    scanf("%d", &q);
    while(q--) solve();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:5: error: declaration does not declare anything [-fpermissive]
   60 |     ios;
      |     ^~~
Language: C++

10
1 1
2 2
5 1000000000000000000
7 3
1 334334334334334334
23847657 23458792534
111111111 111111111
7 7
4 19
9 10

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 10
      | ^~
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <bitset>
#include <string>
#include <cmath>
#include <set>
#include <map>
#define Rep(i, x, y) for (int i = x; i <= y; i ++)
#define Dwn(i, x, y) for (int i = x; i >= y; i --)
#define RepE(i, x) for (int i = pos[x]; i; i = g[i].nex)
#define ev g[i].y
#define mk make_pair<ll, ll>
#define M (1ll << 60)
#define fr first
#define sd second
using namespace std;
typedef long long ll;
typedef double db;
const int N = 300;
const int mod = 1000000007;
int Q, k, s[N];
ll X, Y, ans, f[N];
pair<ll, ll> p[N][N];
void prework() {
	f[0] = 1, f[1] = 1, f[2] = 2, f[3] = 3;
	p[1][1] = mk(1, 2);
	p[1][2] = mk(1, 3);
	s[1] = 2;
	k = 1;
	while (f[k + 1] <= M) {
		k ++;
		f[k + 2] = f[k] + f[k + 1];
		Rep(i, 1, s[k - 1]) {
			ll x = p[k - 1][i].fr, y = p[k - 1][i].sd;
			for (x += y; x <= f[k + 2]; x += y) {
				p[k][++ s[k]] = mk(y, x);
			}
		}
	}
}
void calc(ll x, ll y) {
	if (x <= X && y <= Y && x * 2 > y) (ans += (Y - y) / x + 1) %= mod;
}
int main()
{
	prework();
	scanf ("%d", &Q);
	while(Q --) {
		scanf ("%lld%lld", &X, &Y);
		if (X > Y) swap(X, Y);
		int i = k;
		while (i && p[i][1].fr > X || p[i][1].sd > Y) i --;
		if (!i) i ++;
		if (i == 1) {
			printf("%d %lld\n", i, X % mod * Y % mod);
			continue ;
		}
		ans = 0;
		Rep(j, 1, s[i]) {
			ll x = p[i][j].fr, y = p[i][j].sd;
			calc(x, y);
			calc(y, x);
		}
		printf("%d %lld\n", i, ans);
	}

	return 0;
}

Compiler output:
a.cc: In function 'void prework()':
a.cc:40:52: error: cannot bind rvalue reference of type 'long long int&&' to lvalue of type 'll' {aka 'long long int'}
   40 |                                 p[k][++ s[k]] = mk(y, x);
      |                                                    ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 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_pair.h:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = long long int; _T2 = long long int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = long long int; typename decay<_Tp>::type = long long int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = long long int; typename decay<_Tp2>::type = long long int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~
Language: C++

#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <iostream>

#define For(i, j, k) for(int i = j; i <= k; i++)
#define Forr(i, j, k) for(int i = j; i >= k; i--)
#define x first
#define y second
#define mp make_pair
#define pb push_back

using namespace std;

typedef long long LL;
typedef pair<LL, LL> PII;

const LL MAX = 1e18 + 10;
const int N = 100 + 5;

int n;
LL f[N];
vector<PII> P[N];

void init(){
	freopen("F.in", "r", stdin);
	freopen("F.out", "w", stdout);

	f[0] = f[1] = 1;
	n = 1;
	while(f[n] < MAX) ++n, f[n] = f[n - 1] + f[n - 2];
	f[n + 1] = f[n] + f[n - 1];
	--n;
	P[0].pb(mp(0, 1));
	P[1].pb(mp(1, 2)), P[1].pb(mp(1, 3));

	For(i, 1, n - 1){
		for(PII s : P[i]){
			LL u = s.x, v = s.y;
			//printf("(%lld, %lld) ", u, v);
			if(u == v) continue;
			if(u > v) swap(u, v);
			u += v;
			while(u <= f[i + 3]) P[i + 1].pb(mp(u, v)), u += v;
		}
		//puts("");
	}

	For(i, 1, n){
		sort(P[i].begin(), P[i].end());
		P[i].resize(unique(P[i].begin(), P[i].end()) - P[i].begin());
	}
}

const int Mod = 1e9 + 7;

int main(){
	init();
	int q;
	scanf("%d", &q);
	while(q--){
		LL x, y;
		scanf("%lld%lld", &x, &y);
		if(x > y) swap(x, y);

		int ans = 0;
		while(f[ans + 1] <= x && f[ans + 2] <= y) ++ans;

		if(ans <= 1){
			printf("1 %lld\n", x % Mod * (y % Mod) % Mod);
			continue;
		}
		LL cnt = 0;

		for(PII p : P[ans]){
			LL u = p.x, v = p.y;
			if(u < v) swap(u, v);
			if(u / v >= 2) continue;
			//printf("%lld %lld\n", u, v);
			if(v <= y && x >= u) (cnt += (x - u + v) / v) %= Mod;
			if(v <= x && y >= u) (cnt += (y - u + v) / v) %= Mod;
		}

		printf("%d %lld\n", ans, cnt);
	}
	return 0;
}

Compiler output:
a.cc:24:1: error: 'vector' does not name a type
   24 | vector<PII> P[N];
      | ^~~~~~
a.cc: In function 'void init()':
a.cc:35:9: error: 'P' was not declared in this scope
   35 |         P[0].pb(mp(0, 1));
      |         ^
a.cc: In function 'int main()':
a.cc:76:29: error: 'P' was not declared in this scope
   76 |                 for(PII p : P[ans]){
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PA pair<ll,ll>
const int mod = 1000000007;
vector<PA >a[110];
ll f[110];
int Q;
void init()
{
	a[1].push_back(PA(1,1));
	f[0]=f[1]=1;
	for(int i=2;i<=90;i++)
		f[i]=f[i-1]+f[i-2];
	for(int i=2;i<90;i++)
	{
		a[i].push_back(PA(f[i-1],f[i]));
		a[i].push_back(PA(f[i-1],f[i+1]));
		for(int j=1;j<a[i-1].size();j++)
		{
			PA t=a[i-1][j];
			a[i].push_back(PA(t.second,t.first+t.second));
		}
	}
}
int main()
{
	//freopen("tt.in","r",stdin);
	init();
	scanf("%d",&Q);
	while(Q--)
	{
		ll x,y,ans=0;
		scanf("%lld%lld",&x,&y);
		if(x>y)swap(x,y);
		if(x==1)
		{
			printf("1 %lld\n",y%mod);
			continue;
		}
		if(x==2&&y==2)
		{
			puts("1 4");
			continue;
		}
		int k=upper_bound(f+1,f+90+1,x)-f;
		k=min(k,(int)upper_bound(f+1,f+90+1,y)-f-1);
		
		for(int i=0;i<a[k-1].size();i++)
		{
			PA t=a[k-1][i];
			if(t.second<=x)
			{
				ans+=(y-t.first)/t.second;
				ans+=(x-t.first)/t.second;
			}
		}
		printf("%d %lld\n",k-1,ans%mod);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:25: error: cast from 'long long int*' to 'int' loses precision [-fpermissive]
   47 |                 k=min(k,(int)upper_bound(f+1,f+90+1,y)-f-1);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:47:55: error: invalid operands of types 'int' and 'long long int [110]' to binary 'operator-'
   47 |                 k=min(k,(int)upper_bound(f+1,f+90+1,y)-f-1);
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                         |                              |
      |                         int                            long long int [110]
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PA pair<ll,ll>
const int mod = 1000000007;
vector<PA >a[110];
ll f[110];
int Q;
void init()
{
	a[1].push_back(PA(1,1));
	f[0]=f[1]=1;
	for(int i=2;i<=90;i++)
		f[i]=f[i-1]+f[i-2];
	for(int i=2;i<90;i++)
	{
		a[i].push_back(PA(f[i-1],f[i]));
		a[i].push_back(PA(f[i-1],f[i+1]));
		for(int j=1;j<a[i-1].size();j++)
		{
			PA t=a[i-1][j];
			a[i].push_back(PA(t.second,t.first+t.second));
		}
	}
}
int main()
{
	//freopen("tt.in","r",stdin);
	init();
	scanf("%d",&Q);
	while(Q--)
	{
		ll x,y,ans=0;
		scanf("%lld%lld",&x,&y);
		if(x>y)swap(x,y);
		if(x==1)
		{
			printf("1 %lld\n",y%mod);
			continue;
		}
		if(x==2&&y==2)
		{
			puts("1 4");
			continue;
		}
		int k=upper_bound(f+1,f+90+1,x)-f;
		k=min(k,upper_bound(f+1,f+90+1,y)-f-1);
		
		for(int i=0;i<a[k-1].size();i++)
		{
			PA t=a[k-1][i];
			if(t.second<=x)
			{
				ans+=(y-t.first)/t.second;
				ans+=(x-t.first)/t.second;
			}
		}
		printf("%d %lld\n",k-1,ans%mod);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:22: error: no matching function for call to 'min(int&, long int)'
   47 |                 k=min(k,upper_bound(f+1,f+90+1,y)-f-1);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:47:22: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   47 |                 k=min(k,upper_bound(f+1,f+90+1,y)-f-1);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:47:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   47 |                 k=min(k,upper_bound(f+1,f+90+1,y)-f-1);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int gp[3][7] = {
    {1,3,5,7,8,10,12},
    {4,6,9,11},
    {2},
  };
  int x, y;
  cin >> x >> y;
  int xg= 0, yg = 0;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < sizeof(gp[i]/sizeof(int)); j++) {
      if (gp[i][j] == x) {
        xg = i;
      }
      if (gp[i][j] == y) {
        yg = i;
      }
    }
  }
  if (xg == yg) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: invalid operands of types 'int [7]' and 'long unsigned int' to binary 'operator/'
   14 |     for (int j = 0; j < sizeof(gp[i]/sizeof(int)); j++) {
      |                                ~~~~~^~~~~~~~~~~~
      |                                    | |
      |                                    | long unsigned int
      |                                    int [7]
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int gp[3][] = {
    {1,3,5,7,8,10,12},
    {4,6,9,11},
    {2},
  };
  int x, y;
  cin >> x >> y;
  int xg= 0, yg = 0;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < sizeof(gp[i]/sizeof(int)); j++) {
      if (gp[i][j] == x) {
        xg = i;
      }
      if (gp[i][j] == y) {
        yg = i;
      }
    }
  }
  if (xg == yg) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: declaration of 'gp' as multidimensional array must have bounds for all dimensions except the first
    5 |   int gp[3][] = {
      |       ^~
a.cc:14:32: error: 'gp' was not declared in this scope
   14 |     for (int j = 0; j < sizeof(gp[i]/sizeof(int)); j++) {
      |                                ^~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main() {
	int x, y;
	cin >> x >> y;
	if (x == 2 || y == 2 || x == 11 || y == 4)
		cout << "No" << "\n";
	else if (x == 4 || x == 6 || x == 9) {
		if (y == 6 || y == 9 || y == 11)
			cout << "Yes" << "\n";
		else
			cout << "No" << "\n";
	}
	else {
		if (y == 6 || y == 9 || y == 11)
			cout << "No" << "\n";
		else
			cout << "Yes" << "\n";
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: expected '}' at end of input
   22 |         }
      |          ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  cin >> x >> y;
  vector<int> A = {0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1}
  if (A.at(x) == A.at(y)) {cout << "Yes" << endl;}
  else {cout << "No" << endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'if'
    7 |   if (A.at(x) == A.at(y)) {cout << "Yes" << endl;}
      |   ^~
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else {cout << "No" << endl;}
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  vector<int> A = {0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1}
  if (A.at(x) == A.at(y)) {cout << "Yes" << endl;}
  else {cout << "No" << endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected ',' or ';' before 'if'
    6 |   if (A.at(x) == A.at(y)) {cout << "Yes" << endl;}
      |   ^~
a.cc:7:3: error: 'else' without a previous 'if'
    7 |   else {cout << "No" << endl;}
      |   ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <regex>
#include <locale>
using namespace std;

#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()

using ll = long long;

int main () {
  int a, b;
  cin >> a >> b;
  set s1 = {1,3,5,7,8,10,12};
  set s2 = {4,6,9,11}
  
  if (a == 2) {
    if (b > 2 && (s1.count(b) > 0 || s2.count(b) > 0)) {
      cout << "Yes" << endl;
    }
  } else if (b == 2) {
    if (a == 1) cout << "Yes" << endl;
  } else if ((s1.count(a) > 0 && s2.count(b) > 0) ||
             (s1.count(b) > 0 && s2.count(a) > 0)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: expected ',' or ';' before 'if'
   24 |   if (a == 2) {
      |   ^~
a.cc:28:5: error: 'else' without a previous 'if'
   28 |   } else if (b == 2) {
      |     ^~~~
Language: C++

#include <iostream>
#include<String>
using namespace std;
int main()
{
	int x,y;
	cin>>x>>y;
	if(x==1||x==3||x==5||x==7||x==8||x==10||x==12&&y==1||y==3||y==5||y==7||y==8||y==10||y==12)
	{
		cout<<"yes";
	}
	else if(x==4||x==6||x==9||x==11&&y==4||y==6||y==9||y==11)
	{
		cout<<"yes";
	}
	else if(x==2&&y==2)
	{
		cout<<"yes";
	}
	else
	{
		cout<<"no";
	}
	return 0;
}

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

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

int main(){
  int a,b;
  cin >> a >> b;
  if(a==2||b==2)cout << "No";
  else if(a==4||a==6||a==9||a==11){
    if(b==4||b==6||b==9||a==11){
      cout << "Yes";
    }
    else cout << "Yes";
  }
  else{
    if(b==4||b==6||b==9||a==11){
      cout << "No";
    }
    else cout << "Yes"
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: expected ';' before '}' token
   19 |     else cout << "Yes"
      |                       ^
      |                       ;
   20 |   }
      |   ~
Language: C++

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

int main(){
    int n,m;
    cin>>n>>m;
    if(n<m){
    if(n==2&&n!=m)
        cout<<"No";
    else if(n==4||n==6||n==9||n==11)&&(m==4||m==6||m==9||m==11))
            cout<<"yes";
    }
    else if(n==1||n==3||n==5||n==7||n==8||n==12||n==10)&&(m==1||m==3||m==5||m==7||m==8||m==12||m==10))
            cout<<"yes";
    }
else cout<<"No";
    }
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:39: error: expected identifier before '(' token
   10 |     else if(n==4||n==6||n==9||n==11)&&(m==4||m==6||m==9||m==11))
      |                                       ^
a.cc:13:58: error: expected identifier before '(' token
   13 |     else if(n==1||n==3||n==5||n==7||n==8||n==12||n==10)&&(m==1||m==3||m==5||m==7||m==8||m==12||m==10))
      |                                                          ^
a.cc: At global scope:
a.cc:16:1: error: expected unqualified-id before 'else'
   16 | else cout<<"No";
      | ^~~~
a.cc:17:5: error: expected declaration before '}' token
   17 |     }
      |     ^
a.cc:18:2: error: expected unqualified-id before 'return'
   18 |  return 0;
      |  ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

int main(){
    int n,m;
    cin>>n>>m;
    if(n==2 &&m==2)
        cout<<"Yes";
    else if(n==2&&n!=m)
        cout<<"No";
    else if(n==4||n==6||n==9||n==11){
        if(m==4||m==6||m==9||m==11)
            cout<<"yes";
    }
    else if(n==1||n==3||n==5||n==7||n==8||n==12||n==10){
        if(m==1||m==3||m==5||m==7||m==8||m==12||m==10)
            cout<<"yes";
    }
else cout<<"No";
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>n>>m;
      |     ^~~
a.cc:5:9: error: 'cout' was not declared in this scope
    5 |         cout<<"Yes";
      |         ^~~~
a.cc:7:9: error: 'cout' was not declared in this scope
    7 |         cout<<"No";
      |         ^~~~
a.cc:10:13: error: 'cout' was not declared in this scope
   10 |             cout<<"yes";
      |             ^~~~
a.cc:14:13: error: 'cout' was not declared in this scope
   14 |             cout<<"yes";
      |             ^~~~
a.cc:16:6: error: 'cout' was not declared in this scope
   16 | else cout<<"No";
      |      ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i= 0; i < (n); i++)
using ll= long long int;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {if(a < b) {a= b;return 1;}return 0;}
template <class T> inline bool chmin(T &a, T b) {if(a > b) {a= b;return 1;}return 0;}
ll mod= 1e9 + 7;



int main(){
  int x,y;
  cin >> x>>y;
  int d[13]={0,1,3,1,,2,1,2,1,1,2,1,2,1};
  if(d[x]==d[y]){cout << "Yes" << endl;}else{cout << "No" << endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected primary-expression before ',' token
   14 |   int d[13]={0,1,3,1,,2,1,2,1,1,2,1,2,1};
      |                      ^
Language: C++

//組の練習？

#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  int a, b;
  cin >> a >> b;

  vector <int> vec = {0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2};
  if (vec.at(x) == vec.at(y)) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: 'x' was not declared in this scope
   14 |   if (vec.at(x) == vec.at(y)) cout << "Yes" << endl;
      |              ^
a.cc:14:27: error: 'y' was not declared in this scope
   14 |   if (vec.at(x) == vec.at(y)) cout << "Yes" << endl;
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long  
template <typename T>
bool PN(T x){ if (x <= 1) return false; if (x == 2) return true; for (int i = 2; i < sqrt(x) + 1; i++) if (x % i == 0) return false; return true;}

const ll MOD = 1e9+7;

void solve(){
  int x, y; cin >> x >> y;
  int check[13] = {-1, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
  if(check[x] == checl[y]) cout << "Yes" << endl;
  else cout << "No" << endl;
}

int main()
{
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:12:18: error: 'checl' was not declared in this scope; did you mean 'check'?
   12 |   if(check[x] == checl[y]) cout << "Yes" << endl;
      |                  ^~~~~
      |                  check