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

// A.cpp : Defines the entry point for the console application.
//

#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;

int main()
{
	int n;
	cin >> n;
	char s[50][60];
	int alpha[50][26];
	for (int i = 0; i < 50; i++) {
		for (int j = 0; j < 60; j++) {
			s[i][j] = 0;
	}
	}
	for (int i = 0; i < 50; i++) {
		for (int j = 0; j < 26; j++) {
			alpha[i][j] = 0;
		}
	}
	for (int i = 0; i < n; i++) { cin >> s[i]; }
	

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < strlen(s[i]); j++) {
			alpha[i][s[i][j] - 97] += 1;
		}
	}
	int smallest[26];
	for (int i = 0; i < 26; i++) {
		smallest[i] = alpha[0][i];
	}
	for (int i = 1; i < n; i++) {
		for (int j = 0; j < 26; j++) {
			if (smallest[j] > alpha[i][j]) smallest[j] = alpha[i][j];
		}
	}
	char c;
	for (int i = 0; i < 26; i++) {
		for (int j = 0; j < smallest[i]; j++) {
			c = i + 97;
			cout << c;
		}
	}
	cout << endl;
	//cin >> n;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:37: error: 'strlen' was not declared in this scope
   29 |                 for (int j = 0; j < strlen(s[i]); j++) {
      |                                     ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <stdlib.h>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
const int N = 51;
int n;
string s[N];
bool next[N][26][26];
int Nx[26][26];
int f[N][N], trace[N][N];
int mx;
int main() {
    ios_base :: sync_with_stdio(false); cin.tie(0);
    mx = 1;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> s[i];
        sort(s[i].begin(), s[i].end());
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j < s[i].size(); j++) f[i][j] = 1;
        for (int ii = 0; ii < s[i].size(); ii++)
            for (int jj = ii + 1; jj < s[i].size(); jj++)
                next[i][s[i][ii] - 'a'][s[i][jj] - 'a'] = true;
        for (int ii = 0; ii < 26; ii++)
            for (int jj = 0; jj < 26; jj++)
                Nx[ii][jj] += (int)next[i][ii][jj];
    }
    for (int i = 0; i < N; i++) trace[1][i] = -1;
    for (int k = 1; k <= 1; k++) {
        for (int i = 0; i < s[k].size(); i++)
            for (int j = i + 1; j < s[k].size(); j++) {
                if (Nx[s[k][i] - 'a'][s[k][j] - 'a'] == n) {
                    if (f[k][j] < f[k][i] + 1) {
                        f[k][j] = f[k][i] + 1;
                        trace[k][j] = i;
                        mx = max(mx, f[k][j]);
                    }
                }
            }
    }

    string res = "";
    for (int i = 0; i < s[1].size(); i++)
        if (f[1][i] == mx) {
            for (int chot = i; chot != -1; chot = trace[1][chot]) {
                res = s[1][chot] + res;
            }
            break;
        }
    cout << mx << "\n";
    cout << res;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: reference to 'next' is ambiguous
   23 |                 next[i][s[i][ii] - 'a'][s[i][jj] - 'a'] = true;
      |                 ^~~~
In file included from /usr/include/c++/14/string:47,
                 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_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:7:6: note:                 'bool next [51][26][26]'
    7 | bool next[N][26][26];
      |      ^~~~
a.cc:26:36: error: reference to 'next' is ambiguous
   26 |                 Nx[ii][jj] += (int)next[i][ii][jj];
      |                                    ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:7:6: note:                 'bool next [51][26][26]'
    7 | bool next[N][26][26];
      |      ^~~~
Language: C++

#include <stdio.h>

int main() {
  int a[50][50] = {};
  int N = 0;
  char str[100];

  scanf("%d", &N);

  for (int i = 0; i < N; i++) {
    scanf("%s", str);
    for (int j = 0, jlim = strlen(str); j < jlim; j++) {
      a[i][str[j] - 'a']++;
    }
  }

  for (char c = 'a'; c <= 'z'; c++) {
    int max = 999;
    for (int i = 0; i < N; i++) {
      if (max > a[i][c - 'a']) max = a[i][c - 'a'];
    }

    for (int i = 0; i < max; i++) {
      printf("%c", c);
    }
  }
  printf("\n");

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: 'strlen' was not declared in this scope
   12 |     for (int j = 0, jlim = strlen(str); j < jlim; j++) {
      |                            ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 |
Language: C++

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

int main(void) {
	int paperNum;
	cin >> paperNum;
	int maxCharNum = 50;
	vector<int> minChars('z' - 'a', maxCharNum);
	for (int _numOfPaper = 0; _numOfPaper < paperNum; _numOfPaper++) {
		vector<int> chars('z' - 'a', 0);
		string paper;
		cin >> paper;
		for each (auto chr in paper) chars[chr - 'a']++;
		for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++)
			minChars[numOfAlphabet] = min(chars[numOfAlphabet], minChars[numOfAlphabet]);
	}
	for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++) {
		for (int count = 0; count < minChars[numOfAlphabet]; count++)
			cout << (char)(numOfAlphabet + 'a');
	}
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: expected '(' before 'each'
   18 |                 for each (auto chr in paper) chars[chr - 'a']++;
      |                     ^~~~
      |                     (
a.cc:18:27: error: expected primary-expression before 'auto'
   18 |                 for each (auto chr in paper) chars[chr - 'a']++;
      |                           ^~~~
a.cc:18:21: error: 'each' was not declared in this scope
   18 |                 for each (auto chr in paper) chars[chr - 'a']++;
      |                     ^~~~
a.cc:19:17: error: expected primary-expression before 'for'
   19 |                 for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++)
      |                 ^~~
a.cc:18:65: error: expected ';' before 'for'
   18 |                 for each (auto chr in paper) chars[chr - 'a']++;
      |                                                                 ^
      |                                                                 ;
   19 |                 for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++)
      |                 ~~~                                              
a.cc:19:17: error: expected primary-expression before 'for'
   19 |                 for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++)
      |                 ^~~
a.cc:18:65: error: expected ')' before 'for'
   18 |                 for each (auto chr in paper) chars[chr - 'a']++;
      |                     ~~~~                                        ^
      |                                                                 )
   19 |                 for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++)
      |                 ~~~
Language: C++

#include <iostream>
#include <string>                                                               #include <vector>
#include <utility>
#include <map>
#include <algorithm>

using namespace std;

int main()
{
  int n;
  cin >> n;
  vector<int> counts(26, -1);

  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    vector<int> cnt(26, 0);
    for (auto c: s) ++cnt[c - 'a'];
    for (int j = 0; j < counts.size(); ++j) {
      if (counts[j] < 0 or counts[j] > cnt[j]) counts[j] = cnt[j];
    }
  }

  for (int i = 0; i < counts.size(); ++i) {
    for (int j = 0; j < counts[i]; ++j) cout << static_cast<char>('a' + i);
  }
  cout << endl;
  return 0;
}


Compiler output:
a.cc:2:81: warning: extra tokens at end of #include directive
    2 | #include <string>                                                               #include <vector>
      |                                                                                 ^
a.cc: In function 'int main()':
a.cc:13:3: error: 'vector' was not declared in this scope
   13 |   vector<int> counts(26, -1);
      |   ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include <algorithm>
  +++ |+#include <vector>
    6 | 
a.cc:13:10: error: expected primary-expression before 'int'
   13 |   vector<int> counts(26, -1);
      |          ^~~
a.cc:18:12: error: expected primary-expression before 'int'
   18 |     vector<int> cnt(26, 0);
      |            ^~~
a.cc:19:23: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |     for (auto c: s) ++cnt[c - 'a'];
      |                       ^~~
      |                       int
a.cc:20:25: error: 'counts' was not declared in this scope; did you mean 'const'?
   20 |     for (int j = 0; j < counts.size(); ++j) {
      |                         ^~~~~~
      |                         const
a.cc:21:40: error: 'cnt' was not declared in this scope; did you mean 'int'?
   21 |       if (counts[j] < 0 or counts[j] > cnt[j]) counts[j] = cnt[j];
      |                                        ^~~
      |                                        int
a.cc:25:23: error: 'counts' was not declared in this scope; did you mean 'const'?
   25 |   for (int i = 0; i < counts.size(); ++i) {
      |                       ^~~~~~
      |                       const
Language: C++

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<string> S(n);
	for (auto &S_i : S) cin >> S_i;

	string ans = "";
	for (char c = 'a'; c <= 'z'; ++c) {
		int num = 99999;
		for (const auto &s : S) {
			num = min(num, count(s.begin(), s.end(), c));
		}
		ans.insert(ans.end(), num, c);
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >, void>::difference_type)'
   19 |                         num = min(num, count(s.begin(), s.end(), c));
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:19:34: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'})
   19 |                         num = min(num, count(s.begin(), s.end(), c));
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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,
                 from a.cc:4:
/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:19:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   19 |                         num = min(num, count(s.begin(), s.end(), c));
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

//Jai Shree Krishna
#include <vector>
#include <list>
#include <map>
#include <set>
#include "queue"
#include <deque>
#include <stack>
#include <numeric>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <complex>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <climits>
#include <cassert>
#include <iostream>
#include "fstream"
using namespace std;
#define PI acos(-1)
#define MOD (ll)1000000007
#define pii pair<long long ,long long >
#define ll  long long int
#define loop(i,n) for(ll i=0;i<n;i++)
#define loop2(i,n) for(ll i = 1;i<=n;i+=1)
#define pb push_back
#define mp make_pair
#define EPS 1e-8
void display(vector<int> v1){loop(i,v1.size()){cout<<v1[i]<<" ";}cout<<endl;}
ll dx[8] = {0,1,0,-1,1,1,-1,-1};
ll dy[8] = {1,0,-1,0,1,-1,1,-1};

//Never giving in, fighting to the end




int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    //freopen("/Users/ashish/Desktop/B-large-practice.in.txt", "r", stdin);
    //freopen("/Users/ashish/Desktop/A-large-practice.out.txt", "w", stdout);
    ll n;
    vector<string>v1;
    cin>>n;
    loop(i,n)
    {
        string s1;
        cin>>s1;
        v1.push_back(s1);
    }
    loop(i,26)
    {
        ll mex = (ll)1e18;
        loop(j,v1.size())
        {
            ll cnt = 0 ;
            loop(k,v1[j].size())
            {
                if(v1[j][k]==(char)(i+'a'))
                {
                    cnt+=1;
                }
            }
            mex = min(mex,cnt);
        }
        if(mex==(ll)1e18){
            continue;
        }
        loop(j,mex)
        {
            cout<<(char)(i+'a')l;
        }
    }
    
    
    
    
    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:82:32: error: expected ';' before 'l'
   82 |             cout<<(char)(i+'a')l;
      |                                ^
      |                                ;
Language: C++

#include <bits/stdc++.h>
using namespace std; 
const int dx[]={1,0,-1,0,1,-1,-1,1}; 
const int dy[]={0,1,0,-1,1,1,-1,-1}; 
const int INF = 1e9; 
const long long LINF = 1e18; 
const double EPS = 1e-8; 
#define pb push_back
#define mk make_pair 
#define fr first 
#define sc second 
#define ll long long 
#define reps(i,j,k) for(int i = (j); i < (k); ++i) 
#define rep(i,j) reps(i,0,j) 
#define all(a) (a).begin(),(a).end() 
#define MOD 1000000007 
typedef pair<int,int> Pii;
typedef pair<Pii,int> P;
typedef vector<int> vi;
int main(){
	int N;
	cin >> N;
	string str;
	vector < string > vs;
	int memo[64][64];
	rep(i,N){
		cin >> str;
		vs.pb(str);
		rep(j,str.size()){
			memo[i][str[j]-'a']++;
		}
	}
	string ans = "";
	rep(i,'z'-'a' + 1){
		int a = INF;
		rep(j,N){
			a  = min(a,memo[j][i]);
		}
		rep(j,a){
			ans += i+'a';
		}
	}
	cout << ans << endl;å
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:29: error: '\U000000e5' was not declared in this scope
   43 |         cout << ans << endl;å
      |                             ^
Language: C++

n = input()

counter = [108]* 26
alphabet = "abcdefghijklmnopqrstuvwxyz"
for i in range(n):
    s = raw_input()
    for c in range(26):
        counter[c] = min(counter[c], s.count(alphabet[c]))

res = ""
for c in range(26):
    res += alphabet[c] * counter[c]
print res
        

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

#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

char b[100],c[100],d[100];
int i,j,l,n;

int main()
{
	scanf("%d\n",&n);
	for (i=1;i<=26;i++)
		c[i]=100;
	for (i=1;i<=n;i++)
	{
		gets(b+1);
		l=strlen(b+1);
		memset(d,0,sizeof(d));
		for (j=1;j<=l;j++)
			d[b[j]-96]++;
		for (j=1;j<=26;j++)
			c[j]=min(c[j],d[j]);
	}
	for (i=1;i<=26;i++)
		for (j=1;j<=c[i];j++)
			putchar(96+i);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   17 |                 gets(b+1);
      |                 ^~~~
      |                 getw
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
static const int MAXN = 54;
static const int ALPHABET = 26;

int n;
char s[MAXN];
int ct[ALPHABET], min[ALPHABET];

int main()
{
    scanf("%d", &n); getchar();
    for (int i = 0; i < ALPHABET; ++i) min[i] = MAXN;
    for (int i = 0; i < n; ++i) {
        gets(s);
        int len = strlen(s);
        for (int i = 0; i < ALPHABET; ++i) ct[i] = 0;
        for (int j = 0; j < len; ++j) ++ct[s[j] - 'a'];
        for (int j = 0; j < ALPHABET; ++j) min[j] = std::min(min[j], ct[j]);
    }

    for (int i = 0; i < ALPHABET; ++i)
        for (int j = 0; j < min[i]; ++j) putchar('a' + i);
    putchar('\n');

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

n,m=map(int,input().split())
aa=list(map(int,input().split()))
bb=list(map(int,input().split()))
mod=10**9+7
ss=0
for i in range(n-1):
    ss+=(aa[i+1]-aa[i])*(i+1)*(n-i-1)
    ss%=mod
tt=0
for i in range(m-1):
    tt+=(bb[i+1]-bb[i])*(i+1)*(m-i-1)
    tt%=mod
print((ss*tt)%mod)

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

#include <bits/stdc++.h>
using namespace std;
#define long long ll;
const int MAX=1e5+100;
const int INF=99999999;
const int MOD=1e9+7;
ll x[MAX],y[MAX];

int main()
{   ll n,m;
    cin>>n>>m;
    for(int i=1; i<=n; i++)
        cin>>x[i];
    for(int i=1; i<=m; i++)
        cin>>y[i];
    ll ax=0,ay=0;
    for(int i=1; i<=n; i++)
        ax=(ax+((i-1)*x[i]- (n-i)*x[i]))%MOD;
    for(int i=1; i<=m; i++)
        ay=(ay+((i-1)*y[i]-(m-i)*y[i]))%MOD;
    cout<<ax%MOD*ay%MOD<<endl;
    return 0;
}

Compiler output:
a.cc:7:1: error: 'll' does not name a type
    7 | ll x[MAX],y[MAX];
      | ^~
a.cc: In function 'int main()':
a.cc:10:5: error: 'll' was not declared in this scope
   10 | {   ll n,m;
      |     ^~
a.cc:11:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |     cin>>n>>m;
      |          ^
      |          yn
a.cc:11:13: error: 'm' was not declared in this scope; did you mean 'tm'?
   11 |     cin>>n>>m;
      |             ^
      |             tm
a.cc:13:14: error: 'x' was not declared in this scope
   13 |         cin>>x[i];
      |              ^
a.cc:15:14: error: 'y' was not declared in this scope
   15 |         cin>>y[i];
      |              ^
a.cc:16:7: error: expected ';' before 'ax'
   16 |     ll ax=0,ay=0;
      |       ^~~
      |       ;
a.cc:18:9: error: 'ax' was not declared in this scope
   18 |         ax=(ax+((i-1)*x[i]- (n-i)*x[i]))%MOD;
      |         ^~
a.cc:18:23: error: 'x' was not declared in this scope
   18 |         ax=(ax+((i-1)*x[i]- (n-i)*x[i]))%MOD;
      |                       ^
a.cc:20:9: error: 'ay' was not declared in this scope
   20 |         ay=(ay+((i-1)*y[i]-(m-i)*y[i]))%MOD;
      |         ^~
a.cc:20:23: error: 'y' was not declared in this scope
   20 |         ay=(ay+((i-1)*y[i]-(m-i)*y[i]))%MOD;
      |                       ^
a.cc:21:11: error: 'ax' was not declared in this scope
   21 |     cout<<ax%MOD*ay%MOD<<endl;
      |           ^~
a.cc:21:18: error: 'ay' was not declared in this scope
   21 |     cout<<ax%MOD*ay%MOD<<endl;
      |                  ^~
Language: C++

#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>

#include<queue>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1844674407370955161
typedef long long unsigned int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

template<typename T>
T gcd(T a,T b){
	if(b>0){
		return gcd(b, a % b);
	}else{
		return a;
	}
}

template<typename T>
T lcm(T a,T b){
	T g = gcd(a, b);
	return a * b / g;
}

void clear( std::queue<pair<int,int> > &q )
{
   std::queue<pair<int,int> > empty;
   std::swap( q, empty );
}
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
template<typename T>
std::vector<T> enum_div(T n)//nの約数を列挙
{
	std::vector<T> ret;
	for(T i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}



int main()
{

  int n, m;
  long long xans=0;
  long long yans = 0;
  cin >> n >> m;
  REP(i,1,n+1){
    long long x;
    cin >> x;
    xans += (2 * i - n - 1) * x%MOD;
  }
  REP(i,1,m+1){
    long long y;
    cin >> y;
    yans += (2 * i - m - 1) * y%MOD;
  }
  ll ans=xans*yans%MOD
  cout << ans<< endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:108:3: error: expected ',' or ';' before 'cout'
  108 |   cout << ans<< endl;
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100005;
const int MOD=1e9+7; 
ll x[N],y[N];
int n,m;
int main()
{
	int n;
	scanf("%d%d",&n,&m);
	int maxX=-(1e9+7),minX=1e9+7;
	int maxY=-(1e9+7),minY=1e9+7;
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&x[i]);
	}
	
	for(int i=1;i<=m;i++)
	{
		scanf("%lld",&y[i]);
	}
	sort(x+1,x+n+1);
	sort(y+1,y+m+1);
	ll ans1=0,ans2=0;;
	for(int i=1;i<n;i++)
	{
	     ans1=(ans1%MOD+((x[i+1]-x[i])%MOD*i%MOD*(n-i)%MOD)%MOD)%MOD)%MOD;

	}
	for(int i=1;i<m;i++)
	{
	     ans2=(ans2%MOD+((y[i+1]-y[i])%MOD*i%MOD*(m-i)%MOD)%MOD)%MOD;
	}
	
	 cout<<(ans1%MOD*ans2%MOD)%MOD<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:73: error: expected ';' before ')' token
   28 |              ans1=(ans1%MOD+((x[i+1]-x[i])%MOD*i%MOD*(n-i)%MOD)%MOD)%MOD)%MOD;
      |                                                                         ^
      |                                                                         ;
Language: C++

#include<iostream>
using namespace std;
int main(){
  long n,m,sum1=0,sum2=0,,b4a,a,ans,mod=1000000007,i;
  cin>>n>>m;
  cin>>b4a;
  for(i=1;i<n;i++){
    cin>>a;
    sum1=(sum1+(a-b4a)*i%mod*(n-i)%mod)%mod;
  }
  cin>>b4a;
  for(i=1;i<m;i++){
    cin>>a;
    sum2=(sum2+(a-b4a)*i%mod*(n-i)%mod)%mod;
  }
  ans=sum1*sum2%mod;
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:26: error: expected unqualified-id before ',' token
    4 |   long n,m,sum1=0,sum2=0,,b4a,a,ans,mod=1000000007,i;
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1e9+7;


signed main(){
	int n,m;cin>>n>>m;
	vector<int> x(n),y(m);
	for(auto&& w:x)cin>>w;
	for(auto&& w:y)cin>>w;
	sort(begin(x),end(x));
	sort(begin(y),end(y));
	int x0=x[0],y0=y[0];
	for(auto&& w:x)w-=x0;
	for(auto&& w:y)w-=y0;
	vector<vector<int>> s(n,vector<int>(m,0));
	
	for(int i=1;i<n;i++){
	for(int j=0;j<m;j++){
		s[i][j]=(x[i]%mod)*(y[j]%mod)%mod;	
	}}
	for(int i=1;i<n;i++){
	for(int j=0;j<m;j++){
			s[
}}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }}
      | ^
a.cc:25:27: error: expected ']' before '}' token
   25 |                         s[
      |                           ^
      |                           ]
   26 | }}
      | ~
Language: C++

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

const int MOD = 1000000007; // 今回使う余り
int main() {
	int n, m, x, y;
	cin >> n >> m;
	
	int64_t xsum = 0, ysum = 0;
	for (int i = 0;i < n;i ++) {
		cin >> x;
		xsum = (xsum + (int64_t)(2 * i + 1 - n) * x) % MOD;
	}
	for (int i = 0;i < m;i ++) {
		cin >> y;
		ysum = (ysum + (int64_t)(2 * i + 1 - m) * y) % MOD;
	}
	cout << xsum * ysum % MOD;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

単に式変形すると解ける
xy独立なのでまずはxについて説明するよ
まず、x方向ではΣ[i=1, n] Σ[j=i + 1, n] (xj - xi)が答え
これだと2重ループだけど、あるkを用いてΣ[k = 1, n] ((k - 1)x_k - (n - k)x_k) = Σ[k = 1, n] ((2k - n - 1)x_k)に等しいと分かるとO(n)
y方向も同様にやって終わり
*/

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

#include<cstdio>
#include<algorithm>
#define MN 200001
using namespace std;
 
const int MOD=1e9+7;
int n,m,a[MN],b[MN],A=0,B=0;
int main(){
    scanf("%d%d",&n,&m);
    for (int i=1;i<=n;i++) scanf("%d",&a[i]);sort(a+1,a+1+n);
    for (int i=1;i<=m;i++) scanf("%d",&b[i]);sort(b+1,b+1+m);
    for (int i=1;i<n;i++) A=(1LL*(a[i+1]-a[i])*i%MOD*(n-i)+A)%MOD;
    for (int i=1;i<m;i++) B=(1LL*(b[i+1]-b[i])*i%MOD*(m-i)+B)%MOD;
    printf("%lld\n",1ll*A*B%MOD);
}

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

#include <iostream>
#include <vector>

int main() {
  const long long mod = 1000000007;
  long long n, m;
  std::cin >> n >> m;
  std::vector<long long> x(n);
  std::vector<long long> y(m);
  for (int i = 0; i < n; ++i) {
    std::cin >> x[i];
  }
  for (int i = 0; i < m; ++i) {
    std::cin >> y[i];
  }
  std::sort(x.begin(), x.end());
  std::sort(y.begin(), y.end());
  long long x_sum = 0ull;
  long long y_sum = 0ull;
  for (int i = 0; i < n; ++i) {
    x_sum += (2 * i - n + 1) * x[i];
    x_sum %= mod;
  }
  for (int i = 0; i < m; ++i) {
    y_sum += (2 * i - m + 1) * y[i];
    y_sum %= mod;
  }
  std::cout << (x_sum * y_sum) % mod << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   16 |   std::sort(x.begin(), x.end());
      |        ^~~~
      |        qsort
a.cc:17:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   17 |   std::sort(y.begin(), y.end());
      |        ^~~~
      |        qsort
Language: C

#include<stdio.h>


/*int sa(int a,int b){
  if(a < b)
    return(b - a);
  return(a - b);
  }*/


int main(){
  int n,m,i,j,k,ans = 0;
  int N;
  int x[100000],y[100000],s[99999];

  N = 1000000000 + 7;
  
  scanf("%d %d",&n,&m);
  for(i = 0;i < n;i++)
    scanf("%d",&x[i]);
  for(i= 0;i < m;i++)
    scanf("%d",&y[i]);

  for(i = 0;i < m - 1;i++){
    for(j = i + 1;j < m;j++){
      for(k = 0;k < n - 1;k+)
	s[k] = (x[j] - x[i]) * (y[k + 1] - y[k]);
      if(n % 2 == 0){
	for(k = 1;k <= n / 2 - 1;k++)
	  ans += (k * (n - k) * (s[k - 1] + s[n - k - 1])) % N;
	ans += (s[k / 2 - 1] * n * n / 8) % N;
      }else{
	for(k = 1;k <= (n -1) / 2;k++)
	  ans += (k * (n - k) * (s[k - 1] + s[n - k -1])) % N;
      }
    }
  }
  printf("%d",ans);

  return(0);
}


Compiler output:
main.c: In function 'main':
main.c:26:29: error: expected expression before ')' token
   26 |       for(k = 0;k < n - 1;k+)
      |                             ^
Language: C++

//http://arc071.contest.atcoder.jp/tasks/arc071_b
#include <iostream>
using namespace std;

int n,m;
int x[100000] = {};
int y[100000] = {};
const int mod = 1000000007;

void read_input(){
    int i;
    cin >> n >> m;
    for(i=0; i<n; i++){
        cin >> x[i];
    }
    for(i=0; i<m; i++){
        cin >> y[i];
    }
}

int main(void){
    read_input();
    int i,j;
    int sum_x = 0;
    int sum_y = 0;
    for(i=0; i<n; i++){
        for(j=0; j<i; j++){
            sum_x += (x[i] - x[j]);
            sum_x %= mod;
        }
    }
    for(i=0; i<m; i++){
        for(j=0; j<i; j++){
            sum_y += (y[i] - y[j]);
            sum_y %= mod;
        }
    }
    

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

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main(void){
    long long int i,j,n,m;
    long long int tate=0,yoko=0;
    cin>>n>>m;
    long long int x[n],y[m];
    
    for(i=0;i<n;i++){
        cin>>x[i];
    }
    for(i=0;i<m;i++){
        cin>>y[i];
    }
    
    sort(x,x+n);
    sort(y,y+m);
    
    for(i=0;i<n;i++){
        tate+=(-n+1+i*2)*x[i];
    }
    for(i=0;i<m;i++){
        yoko+=(-m+1+i*2)*y[i];
    }
    
    long long int ans=(tate*yoko)%(1E9+7);

cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:34: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   28 |     long long int ans=(tate*yoko)%(1E9+7);
      |                       ~~~~~~~~~~~^~~~~~~~
      |                            |          |
      |                            |          double
      |                            long long int
Language: C++

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main(void){
    long long int i,j,n,m;
    long long int tate=0,yoko=0;
    cin>>n>>m;
    long long int x[n],y[m];
    
    for(i=0;i<n;i++){
        cin>>x[i];
    }
    for(i=0;i<m;i++){
        cin>>y[i];
    }
    
    sort(x,x+n);
    sort(y,y+m);
    
    for(i=0;i<n;i++){
        tate+=(-n+1+i*2)*x[i];
    }
    for(i=0;i<m;i++){
        yoko+=(-m+1+i*2)*y[i];
    }
    
    cout<<(tate*yoko)%(1E9+7);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   28 |     cout<<(tate*yoko)%(1E9+7);
      |           ~~~~~~~~~~~^~~~~~~~
      |                |          |
      |                |          double
      |                long long int
Language: C++

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main(void){
    long long int i,j,n,m;
    long long int tate=0,yoko=0;
    cin>>n>>m;
    long long int x[n],y[m];
    
    for(i=0;i<n;i++){
        cin>>x[i];
    }
    for(i=0;i<m;i++){
        cin>>y[i];
    }
    
    sort(x,x+n);
    sort(y,y+m);
    
    for(i=0;i<n;i++){
        tate+=(-n+1+i*2)*x[i];
    }
    for(i=0;i<m;i++){
        yoko+=(-m+1+i*2)*y[i];
    }
    
    cout<<(tate*yoko)%(1E+9);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   28 |     cout<<(tate*yoko)%(1E+9);
      |           ~~~~~~~~~~~^~~~~~~
      |                |       |
      |                |       double
      |                long long int
Language: C++

#include <iostream>
#include<alghorithm>
#include<math.h>
using namespace std;
int main(void){
    int i,j,n,m;
    int tate=0,yoko=0;
    cin>>n>>m;
    int x[n],y[m];
    
    for(i=0;i<n;i++){
        cin>>x[i];
    }
    for(i=0;i<m;i++){
        cin>>y[i];
    }
    
    sort(x,x+n);
    sort(y,y+m);
    
    for(i=0;i<n;i++){
        tate+=(-n+1+i*2)*x[i];
    }
    for(i=0;i<m;i++){
        yoko+=(-m+1+i*2)*y[i];
    }
    
    cout<<(tate*yoko)%(1E9+7);
}


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

#include<iostream>
#include<vector>
#include<utility>
#include<math.h>

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pair<int, int> > vp;

#define pb push_back
#define mod 1000000007
#define inf 999999999
#define rep(i, n) for(int i = 0; i < n; i++)
#define For(i, a, n) for(int i = a; i < n; i++)
#define out(n) cout << n << endl;
#define vout(v) rep(i, v.size()) out(v[i]);

int main(){
  ll n, m;
  cin >> n >> m;
  ll x[n], y[m];

  rep(i, n) {
    cin >> x[i];
  }

  rep(i, m) {
    cin >> y[i];
  }

  ll xan = 0, yan = 0;

  rep(i, n) {
    xan += (2 * (i + 1) - 1 - n) * x[i];
    xan %= mod;
  }

  rep(i, m) {
    yan += (2 * (i + 1) - 1 - m) * y[i];
    yan %= mod;
  }

  cout << xan * yan % mod; << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:28: error: expected primary-expression before '<<' token
   46 |   cout << xan * yan % mod; << endl;
      |                            ^~
Language: C++

#include<bits/stdc++.h>

using namespace std;

using ll=long long;

const ll mod=1000000007;

ll mod_pow(ll x,ll n){
    ll res=1;
    while(n>0){
        if(n&1)res=res*x%mod;
        x=x*x%mod;
        n>>=1;
    }
    return res;
}

int main(){
    ll n,m;
    cin>>n>>m;
    for(ll i=0;i<n;++i){
        ll x;cin>>x;
        if(i==0)mix=x;
        if(i==n-1)ma_x=x;
    }
    for(ll i=0;i<m;++i){
        ll x;cin>>x;
        if(i==0)miy=x;
        if(i==m-1)may=x;
    }
    ll ans=(((ma_x-mix)%mod)*((may-miy)%mod))%mod;
    ans=(((ans*mod_pow(2,(n-2)))%mod)*mod_pow(2,(m-2)))%mod;
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'mix' was not declared in this scope
   24 |         if(i==0)mix=x;
      |                 ^~~
a.cc:25:19: error: 'ma_x' was not declared in this scope
   25 |         if(i==n-1)ma_x=x;
      |                   ^~~~
a.cc:29:17: error: 'miy' was not declared in this scope
   29 |         if(i==0)miy=x;
      |                 ^~~
a.cc:30:19: error: 'may' was not declared in this scope
   30 |         if(i==m-1)may=x;
      |                   ^~~
a.cc:32:15: error: 'ma_x' was not declared in this scope
   32 |     ll ans=(((ma_x-mix)%mod)*((may-miy)%mod))%mod;
      |               ^~~~
a.cc:32:20: error: 'mix' was not declared in this scope
   32 |     ll ans=(((ma_x-mix)%mod)*((may-miy)%mod))%mod;
      |                    ^~~
a.cc:32:32: error: 'may' was not declared in this scope
   32 |     ll ans=(((ma_x-mix)%mod)*((may-miy)%mod))%mod;
      |                                ^~~
a.cc:32:36: error: 'miy' was not declared in this scope
   32 |     ll ans=(((ma_x-mix)%mod)*((may-miy)%mod))%mod;
      |                                    ^~~
Language: C++

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

int main()
{
	int n;
	int m;
	int line;
	string str;
	//vector<string> str_vec;
	int count = 0;
	vector<int> X;
	vector<int> Y;
	
	long long res=0;
	

	cin >> n >> m;
	while (cin >> line)
	{
		
		X.push_back(line);
		count++;
		if (count == n)
			break;
	}
	count = 0;
	while (cin >> line)
	{
		Y.push_back(line);
		count++;
		if (count == m)
		{
			break;
		}
	}

	vector<int> X_distance;
	vector<int> Y_distance;

	for (int xi=0;xi<n;++xi)
	{
		for (int xj = xi + 1; xj < n; ++xj)
		{
			X_distance.push_back(X[xj] - X[xi]);
		}
	}
	for (int yi = 0; yi < m; ++yi)
	{
		for (int yj = yi + 1; yj < n; ++yj)
		{
			Y_distance.push_back(Y[yj] - Y[yi]);
		}
	}
	for (auto& elemx : X_distance)
	{
		for(auto& elemy:Y_distance)
		{
			res += elemx*elemy;
		}
	}
	res = res%long long (10e9 + 7);
	
	cout << res << endl;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:19: error: expected primary-expression before 'long'
   66 |         res = res%long long (10e9 + 7);
      |                   ^~~~
Language: C++

#include <iostream>
#include <string.h>
using namespace std;
typedef long long ll;
const int N =  1e5+5,mod=1e9+7;

ll X[N],Y[N];
int main() {
    int n,m;scanf("%d %d",&n,&m);
    for (int i=1; i<=n; i++) {
        scanf("%lld",X+i);
    }
    for (int i=1; i<=m; i++) {
        scanf("%lld",Y+i);
    }
    sort(X+1,X+1+n);
    sort(X+1,X+1+m);
    ll a=0,s=0;
    for (int i=1; i<=n; i++) {
        if(i!=1)    {
            a = (a+((X[i]*(i-1))%mod))%mod;
            a-=s;
        }
        s+=X[i];
    }
    s=0; ll b=a;a=0;
    for (int i=1; i<=m; i++) {
        if(i!=1)    {
            a = (a+((Y[i]*(i-1))%mod))%mod;
            a-=s;a%=mod;
        }
        s+=Y[i];s%=mod;
    }
    ll ans=(a*b)%mod;
    if(ans<0)   ans+=mod;
    cout<<ans<<endl;
    return 0;
}


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

#include <stdio.h>
#include <cstring>
#include <array>

constexpr int N = 1e5;
char S[N+10], T[N+10];
std::array<short, N+1> vS, vT;
constexpr short K = 'A' - 1;



int main(void){
    // A -> BB -> AAAA ; ABBAA -> ABBB
    // A -> AAAA -> AAABB -> BB
    // つまり, A = BB = AAAA
    //        B = AA = BBBB   : 3文字 === 空文字列
    // BA -> BBB = 0 : A = 1, B = 2と置いた時ハッシュ値みたいになるのでは？
    scanf("%s%s", S, T);
    int n = strlen(S), m = strlen(T);
    vS[0] = 0; REP(i, n) vS[i+1] = (vS[i] + S[i] - K) % 3;
    vT[0] = 0; REP(i, m) vT[i+1] = (vT[i] + T[i] - K) % 3;
    int q; scanf("%d", &q);
    while(q--){
        int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d); a--; c--;
        short sss = (vS[b] - vS[a] + 3) % 3;
        short ttt = (vT[d] - vT[c] + 3) % 3;
        puts(sss==ttt ? "YES" : "NO");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: 'i' was not declared in this scope
   20 |     vS[0] = 0; REP(i, n) vS[i+1] = (vS[i] + S[i] - K) % 3;
      |                    ^
a.cc:20:16: error: 'REP' was not declared in this scope
   20 |     vS[0] = 0; REP(i, n) vS[i+1] = (vS[i] + S[i] - K) % 3;
      |                ^~~
Language: C++

import math
inp=lambda:(int,input().split())
s=input()
t=input()
q=int(input())
for _ in range(q):
	a,b,c,d=inp()
	if abs((s[a:b].count('A')-s[a:b].count('B')))==abs((t[a:b].count('A')-t[a:b].count('B'))):
		print('YES')
	else:
		print('NO')


Compiler output:
a.cc:9:23: warning: multi-character character constant [-Wmultichar]
    9 |                 print('YES')
      |                       ^~~~~
a.cc:11:23: warning: multi-character character constant [-Wmultichar]
   11 |                 print('NO')
      |                       ^~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

// #include</home/edison/Coding/cpp/template/debug.cpp>

int spre[100005],tpre[100005];

int main(){
    string s,t; cin>>s>>t;
    for(int i=1;i<=s.size();++i)spre[i]=spre[i-1]+(s[i-1]=='A');
    for(int i=1;i<=t.size();++i)tpre[i]=tpre[i-1]+(t[i-1]=='A');
    auto csa=[&](int l,int r){ return spre[r]-spre[l-1]; };
    auto csb=[&](int l,int r){ return r-l+1-spre[r]+spre[l-1]; };
    auto cta=[&](int l,int r){ return tpre[r]-tpre[l-1]; };
    auto ctb=[&](int l,int r){ return r-l+1-tpre[r]+tpre[l-1]; };
    int q; cin>>q; while(q--){
        int a,b,c,d; cin>>a>>b>>c>>d;
        PDE(csa(a,b),csb(a,b),cta(c,d),ctb(c,d));
        if((csa(a,b)+csb(a,b)*2)%3==(cta(c,d)+ctb(c,d)*2)%3)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'PDE' was not declared in this scope
   18 |         PDE(csa(a,b),csb(a,b),cta(c,d),ctb(c,d));
      |         ^~~
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fbo find_by_order
#define ook order_of_key
#define f first
#define s second
#define pb push_back
#define reset(a,b) memset(a,b,sizeof a);
#define MOD 998244353
#define MID (l+r)/2
#define ALL(x) x.begin(),x.end()
#define debug(x) cout<<#x<<" = "<<(x)<<endl
#define mx 1000003
#define pc(x) putchar_unlocked(x);
typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> pbds;
int n,a,b,c,d,pref1[mx],pref2[mx];
string s1,s2;
int main(){
	cin>>s1>>s2;
	int n=s1.length(),m=s2.length();
	for(int i=1;i<=n;i++){
		pref1[i]=pref1[i-1];
		if(s1[i-1]=='A')pref1[i]++;
		else pref1[i]+=2;
	}
	for(int i=1;i<=m;i++){
		pref2[i]=pref2[i-1];
		if(s2[i-1]=='A')pref2[i]++;
		else pref2[i]+=2;
	}
	cin>>q;
	while(q--){
		cin>>a>>b>>c>>d;
		int sa=pref[b]-pref[a-1];
		int du=pref[d]-pref[c-1];
		if(sa%3==du%3){
			cout<<"YES\n";
		}
		else cout<<"NO\n";
	}
}




Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: 'q' was not declared in this scope
   34 |         cin>>q;
      |              ^
a.cc:37:24: error: 'pref' was not declared in this scope; did you mean 'pref2'?
   37 |                 int sa=pref[b]-pref[a-1];
      |                        ^~~~
      |                        pref2
Language: C++

#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#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};

#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define re(i,a,b) for(i=a;i<=b;i++)

ll i,j,ii,jj;
ll n,m;
ll now=0,tyakuti=0,memo=0;
ll kaisi,k,hazime,owari;
ll a,b,c,d;
char s[100005],t[100005];
ll ss[100005],tt[100005];

int main(){
    cin>>s>>t;
    n=strlen(s);
    m=strlen(t);
    ss[0]=tt[0]=0;
    for(i=1;i<=n;i++){
        if(s[i]=='A'){
            ss[i]=ss[i]+1;
        }else{
            ss[i]=ss[i]+2;
        }
    }
    
    for(i=1;i<=n;i++){
        if(t[i]=='A'){
            tt[i]=tt[i]+1;
        }else{
            tt[i]=tt[i]+2;
        }
    }
    ll q;
    cin>>q;
    for(i=0;i<q;i++){
        cin>>a>>b>>c>>d;
        if((ss[a]-ss[b-1]-tt[c]+tt[d-1])%3==0){
            p("YES");
        }else{
            p("NO");
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:7: error: 'strlen' was not declared in this scope
   46 |     n=strlen(s);
      |       ^~~~~~
a.cc:13:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <algorithm>
  +++ |+#include <cstring>
   13 | #include <vector>
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <random>
#include <deque>

#define INF_LL 1e18
#define INF 1e9

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()

using namespace std;

using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;

const ll MOD = 1e9+7;

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

template<typename T>
void chmax(T &a, T b){
	a = max(a, b);
}

template<typename T>
void chmin(T &a, T b){
	a = min(a, b);
}

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

class RMQ{
	int n;
	vector<int> dat;
public:
	RMQ(int n_){
		n = 1;
		while(n < n_) n *= 2;
		REP(i, n*2-1){
			dat.push_back(INF);
		}
	}

	void update(int x, int i){
		i += n-1;
		dat[i] = x;
		while(i > 0){
			i = (i-1)/2;
			dat[i] = min(dat[i*2+1], dat[i*2+2]);
		}
	}

	int query(int a, int b, int l, int r, int x){
		if(a <= l && r <= b) return dat[x];
		if(r <= a || b <= l) return INF;

		int res = INF;
		res = min(query(a, b, l, (l+r)/2, x*2+1), query(a, b, (l+r)/2, r, x*2+2));
		return res;
	}
	int query(int a, int b){
		return query(a, b, 0, n, 0);
	}
};

const ll mod = 1e9+7;

int main(void){
	string s,t;
cin >> s >> t;
vector<int> s1(s.size()+1,0),s2(t.size()+1,0);
REP(i,s.size()) s1[i+1]=s1[i]+s[i]-'A';
REP(i,t.size()) s2[i+1]=s2[i]+t[i]-'A';
int Q;
REP(q,Q){
int a,b,c,d;
cin>> a >> b >> c >> d;
if((s1[b]-s1[a-1])%3==(s2[d]-s2[c-1])%3)
cout<< "YES" << endl;
else
cout << "NO" << endl; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:137:2: error: expected '}' at end of input
  137 | }
      |  ^
a.cc:123:15: note: to match this '{'
  123 | int main(void){
      |               ^
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <random>
#include <deque>

#define INF_LL 1e18
#define INF 1e9

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()

using namespace std;

using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;

const ll MOD = 1e9+7;

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

template<typename T>
void chmax(T &a, T b){
	a = max(a, b);
}

template<typename T>
void chmin(T &a, T b){
	a = min(a, b);
}

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

class RMQ{
	int n;
	vector<int> dat;
public:
	RMQ(int n_){
		n = 1;
		while(n < n_) n *= 2;
		REP(i, n*2-1){
			dat.push_back(INF);
		}
	}

	void update(int x, int i){
		i += n-1;
		dat[i] = x;
		while(i > 0){
			i = (i-1)/2;
			dat[i] = min(dat[i*2+1], dat[i*2+2]);
		}
	}

	int query(int a, int b, int l, int r, int x){
		if(a <= l && r <= b) return dat[x];
		if(r <= a || b <= l) return INF;

		int res = INF;
		res = min(query(a, b, l, (l+r)/2, x*2+1), query(a, b, (l+r)/2, r, x*2+2));
		return res;
	}
	int query(int a, int b){
		return query(a, b, 0, n, 0);
	}
};

const ll mod = 1e9+7

int main(void){
	string s,t;
cin >> s >> t;
vector<int> s1(s.size()+1,0),s2(t.size()+1,0);
REP(i,s.size()) s1[i+1]=s1[i]+s[i]-'A';
REP(i,t.size()) s2[i+1]=s2[i]+t[i]-'A';
int Q;
REP(q,Q){
int a,b,c,d;
cin>> a >> b >> c >> d;
if((s1[b]-s1[a-1])%3==(s2[d]-s2[c-1])%3)
cout<< "YES" << endl;
else
cout << "NO" << endl; 
}


Compiler output:
a.cc:123:1: error: expected ',' or ';' before 'int'
  123 | int main(void){
      | ^~~