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

#include<bits/stdc++.h>
#include<algorithm>
#include <assert.h>
using namespace std;
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define ll long long 
#define sum(a,b) a=a+b
#define repn(a,b,c) for(int a = b ; a>=c ; a--)
#define mem(a,b) memset(a,b,sizeof(a))

string s;
ll d;
int mod = 1e9 + 7;
ll memo[10001][101][2];

ll dp(ll pos ,ll sum , bool limit){

	if(pos >= s.size()){
		return sum == 0;
	}


	if(memo[pos][sum][limit]!=-1){
		return memo[pos][sum][limit];
	}

	ll num = (int)s[pos]-'0';

	if(limit == true){
		num = 9;
	}

	ll ans = 0;

	rep(i,0,num){
		if(i == (s[pos]-'0')){
			ans = ans + dp(pos+1,(sum + i)% d ,limit);
		}else{
			ans = ans + dp(pos+1,(sum+i)%d , true);
			
		}

		ans=ans%mod;
	}


	return memo[pos][sum][limit] = ans;

}


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

	mem(memo,-1);

	cin>>s>>d;

	ll ans = solve(0,0,0) % mod;
	ans -= 1;
	if(ans < 0) ans += mod;
	cout<<ans<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:18: error: 'solve' was not declared in this scope
   61 |         ll ans = solve(0,0,0) % mod;
      |                  ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int dp[10005][103][7];
const int MOD=1e9+7;
string s;
int d;
inline real(int x){
	x%=d;
	if(x<0)x+=d;
	return x;
}
int main(){
	
	cin>>s>>d;
	int sz=(int)s.size();
	for(int i=0;i<=s[0]-'0'-1;i++) dp[0][i%d][0]++;
	dp[0][(s[0]-'0')%d][1]=1;
	for(register int i=1;i<sz;i++){
		for(int j=0;j<d;j++){
			for(int k=0;k<=9;k++){
				dp[i][j][0]+=dp[i-1][real(j-k)][0];
				if(k<s[i]-'0') dp[i][j][0]+=dp[i-1][real(j-k)][1];
//				cout<<k<<" "<<dp[i-1][real(j-k)][0]<<endl;
				if(dp[i][j][0]>=MOD) dp[i][j][0]-=MOD;
			}
			dp[i][j][1]=dp[i-1][real(j-s[i]+'0')][1];
//			cout<<i<<" "<<j<<" "<<dp[i][j][0]<<" "<<dp[i][j][1]<<endl; 
		}
	}
	cout<<(dp[sz-1][0][0]+dp[sz-1][0][1]-1+MOD)%MOD;
}

Compiler output:
a.cc:7:8: error: ISO C++ forbids declaration of 'real' with no type [-fpermissive]
    7 | inline real(int x){
      |        ^~~~
a.cc: In function 'int main()':
a.cc:18:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |         for(register int i=1;i<sz;i++){
      |                          ^
Language: C++

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

char str[10010];
string s;
int dp[10010][110],f[10010][110],d,sm[10010];

signed main()
{
	gets(str);
	s=str;
	cin>>d;
	dp[0][0]=1;
	for(int i=1;i<=s.size();i++){
		for(int j=0;j<d;j++){
			int w=0;
			if(i==1) w=1;
			for(int k=w;k<=9;k++){
				int val=j+k;
				val%=d;
				dp[i][val]+=dp[i-1][j];
				if(dp[i][val]>=MOD) dp[i][val]-=MOD;
			}
		}
	}
	f[0][0]=1;
	for(int i=1;i<=s.size();i++){
		for(int j=0;j<d;j++){
			for(int k=0;k<=9;k++){
				int val=j+k;
				val%=d;
				f[i][val]+=f[i-1][j];
				if(f[i][val]>=MOD) f[i][val]-=MOD;
			}
		}
	}
	for(int i=1;i<=s.size();i++) sm[i]=sm[i-1]+(s[i-1]-'0');
	int ans=0;
	for(int i=1;i<=s.size();i++){
		int val=sm[i];
		val%=d;
		for(int j=s[i-1]-'0'+1;j<=9;j++){
			val++;
			val%=d;
			ans+=f[s.size()-i][(d-val)%d];
			if(ans>=MOD) ans-=MOD;
		}
	}
	int sum=0;
	for(int i=1;i<=s.size();i++){
		sum+=dp[i][0];
		if(sum>=MOD) sum-=MOD;
	}
	cout<<(sum-ans+MOD)%MOD<<endl;
	return 0;
}

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

// CE !!!
#include <iostream>
#include <vector>
// #include <queue>
// #include <set>
// #include <map>
// #include <unordered_set>
// #include <unordered_map>
// #include <algorithm>
// #include <climits>
#include <cmath>
// #include <utility>
// #include <iomanip>
#include <string>
#include <cstdlib>

using namespace std;

const int maxn = 10002;
const int maxd = 102;
const int mo = 1e9 + 7;

string K;

int n, D, f[maxn][maxd][2];

void add(int &a, int b) {
	a += b;
	a %= mo;
}

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	cin >> K;
	cin >> D;

	n = K.length();
	reverse(K.begin(), K.end());

	int sum = 0;

	f[0][0][0] = f[0][0][1] = 1;
	for (int i = 1; i <= n; ++i) {
		int cur = K[i-1] - '0';
		sum += cur;

		for (int j = 0; j < D; ++j) {
			for (int t = 0; t <= 9; ++t) {
				add(f[i][(j+t)%D][0], f[i-1][j][0]);

				if (t < cur)
					add(f[i][(j+t)%D][1], f[i-1][j][0]);
				else
					if (t == cur)
						add(f[i][(j+t)%D][1], f[i-1][j][1]);
			}
		}
	}

	cout << (f[n][0][1]-1+mo)%mo << endl;

	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define crap ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long int ll;
typedef unsigned long long ull;
typedef std::vector<int> vi;
typedef std::vector<ll> vll;
typedef std::vector<vi > vvi;
typedef std::vector<vll > vvll;
typedef std::pair<int,int> ii;
typedef std::pair< ll, ll > lp;
typedef std::vector<ii> vii;
typedef std::vector<vii > vvii;


#define pb push_back 
#define PB pop_back
#define pf push_front
#define PF pop_front
#define mp make_pair
#define ub(a,b) upper_bound(all(a),b)
#define lb(a,b) lower_bound(all(a),b)
#define bs(a,b) binary_search(all(a),b)
#define mem(a,b) memset(a,b,sizeof(a))
#define in(a,n) f(i,0,n-1)cin>>a[i]
#define in1(a,n) f(i,1,n)cin>>a[i]
#define out(a,n) f(i,0,n-1)cout<<fixed<<setprecision(20)<<a[i]<<" ";cout<<"\n"
#define ff first
#define ss second
#define f(i,a,b) for (int i=a;i<=b;i++)
#define rf(i,a,b) for(int i=a;i>=b;i--)
#define rep(i,n) f(i,0,n-1)
#define clr(a) (a).clear()
#define rz resize
#define sqr(a) ((a) * (a))
#define sz(a) int((a).size())
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin() ,(a).rend()
#define endl '\n'

const int M=(int)1e9+7;

string num;
int n,d;

ll dp[10005][2][90055][2];
bool vis[10005][2][90055][2];

ll go(int pos, int f, int sum, int start)
{
	if (pos==n)
	{
		if (sum%d==0 && sum > 0LL)
			return 1;
		else
			return 0;
	}

	ll &ans=dp[pos][f][sum][start];

	if (vis[pos][f][sum][start])
		return ans;

	vis[pos][f][sum][start]=true;
	ans=0LL;

	int LMT=(f)? 9 : num[pos]-'0';

	if (!start)
	{
		f(i,0,LMT)
		{
			int nf=1;
			if (f==0 && i==LMT)nf=0;
			ans=(ans+go(pos+1,nf,sum+i,start))%M;
		}
	}
	else
	{
		f(i,1,LMT)
		{
			int nf=1;
			if (f==0 && i==LMT)nf=0;
			ans=(ans+go(pos+1,nf,sum+i,0))%M;
		}
		ans=(ans+go(pos+1,1,sum,1))%M;
	}

	return ans;


} 

int main(int argc, char const *argv[])
{
	crap;
	cin>>num;
	n=num.length();
	cin>>d;
	cout<<go(0,0,0,1)<<endl;
	return 0;
}

Compiler output:
/tmp/cc8fJcHe.o: in function `go(int, int, int, int)':
a.cc:(.text+0xc9): relocation truncated to fit: R_X86_64_PC32 against symbol `vis' defined in .bss section in /tmp/cc8fJcHe.o
a.cc:(.text+0x117): relocation truncated to fit: R_X86_64_PC32 against symbol `vis' defined in .bss section in /tmp/cc8fJcHe.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<sstream>
 
using namespace std;
		
	long long dp[10099][121]; // KONJU NEMORAS SUMU NEGO %moD
	#define MOD 1000000007
	int d; 
	
	long long suma = 0;
	string A; 
	
	void rek(int idx, int pass){
		
		//cout << "kurac" ;
		
		if(idx == A.size()){
		//	cout << pass << " " <<"KRAJ";
			if(pass%d==0)suma++;
			return;
		}
		
		for(int i = 0; i < A[idx] - '0'; i++){
			suma += dp[A.size() - idx - 1][((d - i - pass)%d + 5*d)%d];
			suma %= MOD;
		//	suma = (suma + dp[A.size() - idx - 1][((d - i - pass)%d + d)%d])%MOD;
		//	cout << A.size() - idx - 1 << " " << ((d- i - pass)%d + d)%d << endl;
		//	cout << dp[19][2] << endl;
		//	cout << suma << " " << A.size() - idx - 1 << " " << dp[A.size() - idx - 1][((d - i - pass)%d + 5*d)%d] << " " << ((d - i - pass)%d + 5*d)%d << endl;
		} 
		
		//cout << suma <<  " " << idx << endl; system("pause");
		pass += A[idx] - '0';
		pass%=d;
		
		rek(idx+1,pass);
		
		return;
		
	}
 
int main(){
 
	cin >> A;
	cin >> d;
	
	//cout << d << endl;
	
	//cout << (-1)%222 << endl;
	
	dp[0][0] = 1;
	
	for(int i = 0; i < 10009; i++){
		
		for(int j = 0; j < 111; j++){
			
			dp[i][j]%=MOD;
			
	//		cout << dp[i][j] << " ";
			for(int k = 0; k < 10; k++){
				
				dp[i+1][(j+k)%d] += dp[i][j];
				dp[i+1][(j+k)%d]%=MOD;
				
			}
		}
	//	cout <<endl;
		
	}
	
	//system("pause");
	//suma += dp[B.size()-1][0];
	//cout << suma << endl;
	
	rek(0,0);
	cout <<(suma - 1)%MOD + MOD)%MOD;
	
 
 
 
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:36: error: expected ';' before ')' token
   83 |         cout <<(suma - 1)%MOD + MOD)%MOD;
      |                                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ff first
#define ss second
#define ll long long
#define pq priority_queue
#define mii map<int,int>
 
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef set<int> si;
typedef vector<vi> vii;
typedef vector<ii> vpi;
typedef vector<ll> vll;
int oo = (1e9) + 7;
 
string s;
int d;
int tb[10005][105][2];
vi num;
 
int dp(int i, int n, int f) {
    if(i == (int)s.size() and n == 0) return 1;
    if(i == (int)s.size()) return 0;
    if(tb[i][n][f] != -1) return tb[i][n][f];
 
    int limit = f == 0 ? num[i] : 9;
    // Se o número formado já é menor que a entrada, podemos colocar qualquer dígito.
 
    int ans = 0;
    for(int dgt = 0; dgt <= limit; dgt++)
    {
        if(f == 0 and dgt < limit) ans = ans%oo + dp(i+1, (n%d+dgt%d)%d, 1)%oo;
        else if(f == 0 and dgt == limit) ans = ans%oo + dp(i+1, (n%d+dgt%d)%d, 0)%oo;
        if(f == 1) ans = ans%oo + dp(i+1, (n%d+dgt%d)%d, f)%oo;  
    }
    tb[i][n][f] = ans % oo;
    return ans % oo;
}
 
int main() {
    cin >> s >> d;
 
   
    for(size_t i = 0; i < s.size(); i++)
    {
        num.push_back(s[i] - '0');
    }
   
    memset(tb, -1, sizeof tb);
    printf("%d\n", (dp(0, 0, 0)+mod-1) % mod);
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:33: error: 'mod' was not declared in this scope; did you mean 'modf'?
   52 |     printf("%d\n", (dp(0, 0, 0)+mod-1) % mod);
      |                                 ^~~
      |                                 modf
Language: C++

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

string S;
char s[11111];

int m=1e9+7,dp[10009][2][100],p,d;


int dfs(int idx,int z,bool tight){
  if(idx==s.size())return !z;
  int &res=dp[idx][tight][z];
  if(~res)return res;
  res=0;
  int r=(tight?9:s[idx]-48);
  for(int i=0;i<=r;i++){
    res+=dfs(idx+1,(z+i)%d,tight||i<r);
    res%=m;
  }
  return res;
}

int main(){
  memset(dp,-1,sizeof dp);
  getline(cin,S);
  for(int i=0;i<s.size();i++)s[i]=S[i];
  cin>>d;
  cout<<(dfs(0,0,0)-1+m)%m<<endl;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Compiler output:
a.cc: In function 'int dfs(int, int, bool)':
a.cc:11:13: error: request for member 'size' in 's', which is of non-class type 'char [11111]'
   11 |   if(idx==s.size())return !z;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:26:19: error: request for member 'size' in 's', which is of non-class type 'char [11111]'
   26 |   for(int i=0;i<s.size();i++)s[i]=S[i];
      |                   ^~~~
Language: C++

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

char s[111111];

int m=1e9+7,dp[10009][2][100],p,d;


int dfs(int idx,int z,bool tight){
  if(idx==strlen(s))return !z;
  int &res=dp[idx][tight][z];
  if(~res)return res;
  res=0;
  int r=(tight?9:s[idx]-48);
  for(int i=0;i<=r;i++){
    res+=dfs(idx+1,(z+i)%d,tight||i<r);
    res%=m;
  }
  return res;
}

int main(){
  memset(dp,-1,sizeof dp);
  gets(s);
  scanf("%d",&d);
  cout<<(dfs(0,0,0)-1+m)%m<<endl;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
void OUT(bool b){cout<<(b?"YES":"NO")<<endl;}
void Out(bool b){cout<<(b?"Yes":"No")<<endl;}
void out(bool b){cout<<(b?"yes":"no")<<endl;}
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int clz(int x) { return 31 - __builtin_clz(x); }
int clz(ll x) { return 63 - __builtin_clzll(x); }
int ctz(int x) { return __builtin_ctz(x); }
int ctz(ll x) { return __builtin_ctzll(x); }

class compare {
public:
	bool operator()(tuple<ll, ll> a, tuple<ll, ll> b) {
		return (get<1>(a) > get<1>(b));
	}
};

ll dp[10002][2][100];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int d;
	string s;
	cin>>s>>d;
	dp[0][0][0]=1;
	rep(i,s.size()){
		rep(j,2){
			int t=(j?9:s[i]-'0');
			rep(k,d){
				rep(l,t+1){
					dp[i+1][j||l!=t][(k+l)%d]+=dp[i][j][k];
					dp[i+1][j||l!=t][(k+l)%d]%=MOD;
				}
			}
		}
	}
	ll ans=0;
	rep(i,2){
		ans+=dp[s.size()][i][0];
	}
	ans--;
	ans=(ans+MOD)%=MOD;
	cout<<ans<<endl;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:17: error: lvalue required as left operand of assignment
   75 |         ans=(ans+MOD)%=MOD;
      |             ~~~~^~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int k, n, d[1005];
ll mod = 1e9 + 7;
ll f[1005][105][105];
string str;
 
void tra() {
  n = str.length();
	for (int i = 0; i < str.length(); i++) {
		d[i+1] = str[i] - '0';
	}
}
 
ll solve() {
	if (str == "0") return 1;
	tra();
	memset(f, 0, sizeof(f));
	int x1 = 0, x2 = 0;
	     for (int i = 1; i <= n; i++) {
		for (int x = 0; x < k; x++) {
			for (int y = 0; y < k; y++) {
				for (int j = 0; j <= 9; j++) {
					f[i][(x * 10 + j) % k][(y + j) % k] += f[i - 1][x][y];
				}
			}
		}
		for (int j = 0; j < d[i]; j++)
			f[i][(x1 * 10 + j) % k][(x2 + j) % k]++;
		x1 = (x1 * 10 + d[i]) % k;
		x2 = (x2 + d[i]) % k;
	}
	if (x1 == 0 && x2 == 0)
		f[n][0][0]++;
	ll ret = 0;
	     for(int i = 0; i < k; i++) {
	       ret += f[n][i][0];
	       ret %= mod;
	     }
	return ret-1;
}
 
int main() {
  cin >> str;
  cin >> k;
  cout << solve() << endl;
}


Compiler output:
a.cc: In function 'll solve()':
a.cc:20:9: error: 'memset' was not declared in this scope
   20 |         memset(f, 0, sizeof(f));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include <string>

using namespace std;

string N;
int D;

int dp[100][2][10001];

int rec(int k = 0, bool tight = true, int sum = 0) {
	if (sum > D) {
		return 0;
	}
	if (k == N.size()) {
		return sum == D;
	}

	int x = N[k] - '0';
	int r = (tight ? x : 9);

	int &res = dp[k][tight][sum];
	if (~res) return res;
	res = 0;

	for (int i = 0; i <= r; ++i) {
		res += rec(k + 1, tight && i == r, sum + i);
		res %= (int)10e9+7;
	}

	return res;
}

int main(int argc, char *argv[]) {
	cin >> N >> D;

	memset(dp, -1, sizeof(dp));
	cout << rec() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:37:9: error: 'memset' was not declared in this scope
   37 |         memset(dp, -1, sizeof(dp));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

string N;
int D;

int dp[100][2][10001];

int rec(int k = 0, bool tight = true, int sum = 0) {
  if (sum > D) {
    return 0;
  }
  if (k == N.size()) {
    return sum == D;
  }

  int x = N[k] - '0';
  int r = (tight ? x : 9);

  int &res = dp[k][tight][sum];
  if (~res) return res;
  res = 0;

  for (int i = 0; i <= r; ++i) {
    res += rec(k + 1, tight && i == r, sum + i);
    res %= mod;
  }

  return res;
}

int main(int argc, char *argv[]) {
  cin >> N >> D;

  memset(dp, -1, sizeof(dp));
  cout << rec() << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int rec(int, bool, int)':
a.cc:26:12: error: 'mod' was not declared in this scope; did you mean 'modf'?
   26 |     res %= mod;
      |            ^~~
      |            modf
Language: C++

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

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;


//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


const int mod = 1e9 + 7;
int main(){
    string A;
    int D;
    cin >> A >> D;
    ll dp[100001][2][D+1];
    const ll n = A.size();

    dp[0][0][0] = 1;635270834

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 2; j++) {
            for (int l = 0; l < D; l++) {
                int x = j ? 9 : A[i] - '0';
                for (int d = 0; d <= x; d++) {
                    dp[i + 1][j || d < x][(l + d) % D] += dp[i][j][l];
                    dp[i + 1][j || d < x][(l + d) % D] %= mod;
                }
            }
        }
    }
    int ans = 0;

    for (int j = 0; j < 2; j++) {
        ans += dp[n][j][0];
    }
    cout << (ans-1==0?mod:ans-1) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:30: error: expected ';' before 'for'
   35 |     dp[0][0][0] = 1;635270834
      |                              ^
      |                              ;
   36 | 
   37 |     for (int i = 0; i < n; i++) {
      |     ~~~                       
a.cc:37:21: error: 'i' was not declared in this scope
   37 |     for (int i = 0; i < n; i++) {
      |                     ^
Language: Java

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class Main

	static int mod = (int) 1e9 + 7;
	static ArrayList<Integer> gr[];
	static int ar[];
	static Scanner sc = new Scanner(System.in);
	static int pri[] = new int[(int) 1e6 + 5];
	static StringBuilder out = new StringBuilder();

	static long[][] dp;

	static int h[];

	public static void main(String[] args) throws IOException {
		int t = 1;// sc.nextInt();

		while (t-- > 0) {
			int n = sc.nextInt();
			s = sc.next();
			dp=new long[n+1][n+1];
			
			System.out.println(solve(n));
			
		}

	}

	static String s;

	static int[]v=new int [300000];
	public static long solve(int n) {
		char []ch=s.toCharArray();
		dp=new long[n+1][n+1];
		dp[1][1]=1;
		
		long []pre=new long[n+1];
		for(int i=2;i<=n;i++) {
			for(int j=1;j<=i;j++) {
				pre[j]=pre[j-1]+dp[i-1][j];
				pre[j]%=mod;
			}
	        if (ch[i-2] == '<')
	        {
	            for (int j = 1; j<=i; j++)
	                dp[i][j] = pre[j-1];
	        }
	        else
	        {
	        	
	            for (int j = 1; j<=i; j++)
	                dp[i][j] = (pre[i]-pre[j-1]+mod)%mod;
	        }
	    }
	    int ans = 0;
	    for (int i = 1; i<=n; i++)
	        ans = (int) ((ans+dp[n][i])%mod);
	    
	    return ans;
		}

}

Compiler output:
Main.java:8: error: '{' expected
public class Main
                 ^
Main.java:11: error: class, interface, enum, or record expected
	static ArrayList<Integer> gr[];
	       ^
Main.java:12: error: class, interface, enum, or record expected
	static int ar[];
	       ^
Main.java:13: error: unnamed classes are a preview feature and are disabled by default.
	static Scanner sc = new Scanner(System.in);
	       ^
  (use --enable-preview to enable unnamed classes)
Main.java:14: error: class, interface, enum, or record expected
	static int pri[] = new int[(int) 1e6 + 5];
	       ^
Main.java:19: error: class, interface, enum, or record expected
	static int h[];
	       ^
Main.java:68: error: class, interface, enum, or record expected
}
^
7 errors
Language: C++

#include<iostream>
  
int const MAXN = 3000;
int const MOD = 1000000007;

char s[MAXN];

int N;
int dp[2][MAXN];

int main() {
  std::cin >> N;
  std::cin >> s;

  for(int i = 0; i < N; ++i) dp[0][i] = 1;

  for(int j = 0; j < N-1; ++j) {
    if(s[j] == '>') {
      dp[(j+1)%2][N-j-2] = dp[j%2][N-j-1];
      for(int i = N-j-3; i >= 0; --i) {
        dp[(j+1)%2][i] = (dp[(j+1)%2][i+1] + dp[j%2][i+1])%MOD;
      }
    } else {
      dp[(j+1)%2][0] = dp[j%2][0];
      for(int i = 1; i < N-j-1; ++i) {
        dp[(j+1)%2][i] = (dp[(j+1)%2][i-1] + dp[j%2][i])%MOD;
      }
    }
  }
  std::cout << dp[(N-1)%2][0] << std::endl;
  return 0;


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

#include <iostream>
constexpr int MOD = 1e9 + 7;
long n, dp[3030][3030];
string s;

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

  dp[1][1] = 1;
  for(int i = 2; i <= n; ++i) {
    for(int j = 2; j <= n; ++j) (dp[i-1][j] += dp[i-1][j-1]) %= MOD;
    for(int now = 1; now <= i; ++now) {
      int L, R;
      if(s[i-2] == '<') L = 1, R = now - 1;
      else L = now, R = i;
      if(L <= R) (dp[i][now] += dp[i-1][R] - dp[i-1][L-1] + MOD) %= MOD;
    }
  }
  
  long ans = 0;
  for(int i = 1; i <= n; ++i) ans = (ans + dp[n][i]) % MOD;
  cout << ans;
  return 0;
}

Compiler output:
a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
    4 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> n >> s;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:15: error: 's' was not declared in this scope
    7 |   cin >> n >> s;
      |               ^
a.cc:22:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |   cout << ans;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  longlong n,i,j,sum,dp[3001][3001],mod=1000000007;
  char s[3333];
  cin>>n>>s;
  for(i=1;i<=n;i++)
    for(j=0;j<n;j++)
      dp[i][j]=0;
  for(j=0;j<n;j++)
    dp[0][j]=1;
  for(i=1;i<n;i++){
    sum=0;
    if(s[i-1]=='<'){
      for(j=1;j<n;j++){
        sum=(sum+dp[i-1][j])%mod;
        dp[i][j-1]=sum;
      }
    }
    else{
      for(j=0;j<n-1;j++){
        sum=(sum+dp[i-1][j])%mod;
        dp[i][j]=sum;
      }
    }
  }
  cout<<dp[n-1][0]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'longlong' was not declared in this scope
    4 |   longlong n,i,j,sum,dp[3001][3001],mod=1000000007;
      |   ^~~~~~~~
a.cc:6:8: error: 'n' was not declared in this scope
    6 |   cin>>n>>s;
      |        ^
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=1;i<=n;i++)
      |       ^
a.cc:8:9: error: 'j' was not declared in this scope
    8 |     for(j=0;j<n;j++)
      |         ^
a.cc:9:7: error: 'dp' was not declared in this scope
    9 |       dp[i][j]=0;
      |       ^~
a.cc:10:7: error: 'j' was not declared in this scope
   10 |   for(j=0;j<n;j++)
      |       ^
a.cc:11:5: error: 'dp' was not declared in this scope
   11 |     dp[0][j]=1;
      |     ^~
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=1;i<n;i++){
      |       ^
a.cc:13:5: error: 'sum' was not declared in this scope
   13 |     sum=0;
      |     ^~~
a.cc:15:11: error: 'j' was not declared in this scope
   15 |       for(j=1;j<n;j++){
      |           ^
a.cc:16:18: error: 'dp' was not declared in this scope
   16 |         sum=(sum+dp[i-1][j])%mod;
      |                  ^~
a.cc:16:30: error: 'mod' was not declared in this scope
   16 |         sum=(sum+dp[i-1][j])%mod;
      |                              ^~~
a.cc:21:11: error: 'j' was not declared in this scope
   21 |       for(j=0;j<n-1;j++){
      |           ^
a.cc:22:18: error: 'dp' was not declared in this scope
   22 |         sum=(sum+dp[i-1][j])%mod;
      |                  ^~
a.cc:22:30: error: 'mod' was not declared in this scope
   22 |         sum=(sum+dp[i-1][j])%mod;
      |                              ^~~
a.cc:27:9: error: 'dp' was not declared in this scope
   27 |   cout<<dp[n-1][0]<<endl;
      |         ^~
Language: C++

#include<iostream>
using namespace std;
int main(){
  ll n,i,j,sum,dp[3001][3001],mod=1000000007;
  char s[3333];
  cin>>n>>s;
  for(i=1;i<=n;i++)
    for(j=0;j<n;j++)
      dp[i][j]=0;
  for(j=0;j<n;j++)
    dp[0][j]=1;
  for(i=1;i<n;i++){
    sum=0;
    if(s[i-1]=='<'){
      for(j=1;j<n;j++){
        sum=(sum+dp[i-1][j])%mod;
        dp[i][j-1]=sum;
      }
    }
    else{
      for(j=0;j<n-1;j++){
        sum=(sum+dp[i-1][j])%mod;
        dp[i][j]=sum;
      }
    }
  }
  cout<<dp[n-1][0]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
    4 |   ll n,i,j,sum,dp[3001][3001],mod=1000000007;
      |   ^~
a.cc:6:8: error: 'n' was not declared in this scope
    6 |   cin>>n>>s;
      |        ^
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=1;i<=n;i++)
      |       ^
a.cc:8:9: error: 'j' was not declared in this scope
    8 |     for(j=0;j<n;j++)
      |         ^
a.cc:9:7: error: 'dp' was not declared in this scope
    9 |       dp[i][j]=0;
      |       ^~
a.cc:10:7: error: 'j' was not declared in this scope
   10 |   for(j=0;j<n;j++)
      |       ^
a.cc:11:5: error: 'dp' was not declared in this scope
   11 |     dp[0][j]=1;
      |     ^~
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=1;i<n;i++){
      |       ^
a.cc:13:5: error: 'sum' was not declared in this scope
   13 |     sum=0;
      |     ^~~
a.cc:15:11: error: 'j' was not declared in this scope
   15 |       for(j=1;j<n;j++){
      |           ^
a.cc:16:18: error: 'dp' was not declared in this scope
   16 |         sum=(sum+dp[i-1][j])%mod;
      |                  ^~
a.cc:16:30: error: 'mod' was not declared in this scope
   16 |         sum=(sum+dp[i-1][j])%mod;
      |                              ^~~
a.cc:21:11: error: 'j' was not declared in this scope
   21 |       for(j=0;j<n-1;j++){
      |           ^
a.cc:22:18: error: 'dp' was not declared in this scope
   22 |         sum=(sum+dp[i-1][j])%mod;
      |                  ^~
a.cc:22:30: error: 'mod' was not declared in this scope
   22 |         sum=(sum+dp[i-1][j])%mod;
      |                              ^~~
a.cc:27:9: error: 'dp' was not declared in this scope
   27 |   cout<<dp[n-1][0]<<endl;
      |         ^~
Language: C++

#include<iostream>
using namespace std;
int dp[3000][3000];
string s;
int dp(int i,int j);
int main()
{
  int n;
  cin>>n;
  cin>>s;
  for(int x=0;x<n;x++)
  {
   for(int y=1;y<=x+1;y++)
   {
     dp[x][y]=-1;
   }
  }
  dp[0][1]=1;
  for(int m=1;m<=n;m++)
  {
   ans+=dp(n-1,m);
  }
  return 0;
}
int dp(int i,int j)
{
 if(dp[i][j]!=-1)return dp[i][j];
 int q=0;
 if(s[i-1]=='>'){
                for(int k=j,k<=i;k++)
                {
                  q+=dp(i-1,k);
                }
              }
  else {
         for(int k=1;k<j;k++)
         {
           q+=dp(i-1,k);
         }
       }
  dp[i][j]=q;
  return q;
}  


Compiler output:
a.cc:5:19: error: 'int dp(int, int)' redeclared as different kind of entity
    5 | int dp(int i,int j);
      |                   ^
a.cc:3:5: note: previous declaration 'int dp [3000][3000]'
    3 | int dp[3000][3000];
      |     ^~
a.cc: In function 'int main()':
a.cc:21:4: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |    ans+=dp(n-1,m);
      |    ^~~
      |    abs
a.cc:21:11: error: 'dp' cannot be used as a function
   21 |    ans+=dp(n-1,m);
      |         ~~^~~~~~~
a.cc: At global scope:
a.cc:25:19: error: 'int dp(int, int)' redeclared as different kind of entity
   25 | int dp(int i,int j)
      |                   ^
a.cc:3:5: note: previous declaration 'int dp [3000][3000]'
    3 | int dp[3000][3000];
      |     ^~
a.cc: In function 'int dp(int, int)':
a.cc:30:30: error: expected ';' before '<=' token
   30 |                 for(int k=j,k<=i;k++)
      |                              ^~
      |                              ;
a.cc:30:30: error: expected primary-expression before '<=' token
   30 |                 for(int k=j,k<=i;k++)
      |                              ^~
a.cc:32:24: error: 'dp' cannot be used as a function
   32 |                   q+=dp(i-1,k);
      |                      ~~^~~~~~~
a.cc:38:17: error: 'dp' cannot be used as a function
   38 |            q+=dp(i-1,k);
      |               ~~^~~~~~~
Language: Java


import java.util.Scanner;

/**
 *
 * @author dannyyang
 */
public class TPermutation {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int N=Integer.parseInt(input.nextLine());
        String word=input.nextLine();
        long dp[][]=new long[N+1][N+1];
        dp[N][0]=1;
        int count=1;
        long mod=1000000000+7;
        for(int i=N-1;i>=1;i--){
            long sum=0;
            
                
            if(word.charAt(i-1)=='<'){
                
                for(int j=count;j>=0;j--){
                    sum+=dp[i+1][j];
                    dp[i][j]=sum;
                   // System.out.print(dp[i][j]+" ");
                }
               // System.out.println();
            }
            else{
                for(int j=0;j<=count;j++){
                    dp[i][j]=sum;
                    sum+=dp[i+1][j];
                   // System.out.print(dp[i][j]+" ");
                }
              //  System.out.println();
            }
            count++;
            
        }
        long answer=0;
        for(int i=0;i<N;i++){
            answer+=dp[1][i];
        }
        System.out.println(answer);
    }
    
}


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

long mod=1e9+7,dp[3333][3333];
c,i,j;
main(n)
{
	scanf("%d\n",&n);
	dp[0][0]=1;
	for(;++i<n;)
	{
		c=getchar();
		for(j=0;j<=i;j++)
		{
			dp[i][j]=c=='<'?(*dp[i-1]-dp[i-1][j]+mod)%mod:dp[i-1][j];
		}
		for(;j--;)dp[i][j]=(dp[i][j]+dp[i][j+1])%mod;
	}
	printf("%d",*dp[n-1]);
}

Compiler output:
a.cc:2:1: error: 'c' does not name a type
    2 | c,i,j;
      | ^
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token
    3 | main(n)
      |     ^
Language: C++

#include <bits/stdc++.h> 
using namespace std;
 
#define sz(a) int(a.size())
#define reset(a,b) memset(a,b,sizeof(a))
#define pb					push_back
#define eb					emplace_back
#define mp					make_pair
#define endl 				'\n'
#define gc					getchar_unlocked
#define pc					putchar_unlocked
#define FASTIO std::ios::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL);
#define MAX_DIGITS 7 // 7 digits in 1 000 000
static const long long buf_len = (1 << 14);
static const long long buf_max = (1 << 04);
static char buf_out[buf_len];
static char buf_num[buf_max];
static long long buf_pos = 0;
#ifdef _WIN32
#define GETCHAR() _getchar_nolock()
#define PUTCHAR(c) _putchar_nolock(c)
#elif __unix__
#define GETCHAR() getchar_unlocked()
#define PUTCHAR(c) putchar_unlocked(c)
#else
#define GETCHAR() getchar()
#define PUTCHAR(c) putchar(c)
#endif
#define MOD 1000000007  
#define lld long long 
typedef long long ll;
tatic const lld nax=1e6+5;
 
const int MAXN = 16;
const int MAXL = (1 << 16) + 10;
 
vector<int> grafo[MAXL];
ll valor[MAXL],dp[MAXL],mat[MAXN][MAXN];
int vis[MAXL],N;
 
void brute(int pos,int bitmask,int submask){
 
	if(pos == N){
		if(__builtin_popcount(submask) == 0) return;
		grafo[bitmask].push_back(submask);
		return;
	}
 
	brute(pos+1,bitmask,submask);
	brute(pos+1, bitmask | (1 << pos), submask );
	brute(pos+1, bitmask | (1 << pos), submask | (1 << pos) );
 
}
 
void calcula(){
 
	for(int bitmask = 1;bitmask < (1 << N);bitmask++){
		for(int i = 0;i<N;i++){
			if(!(bitmask & (1 << i))) continue;
			for(int j = i+1;j<N;j++){
				if(!(bitmask & (1 << j))) continue;
				valor[bitmask] += mat[i][j];
			}
		}
	}
 
}
 
ll solve(int bitmask){
 
	if(bitmask == 0) return 0;
	if(vis[bitmask]) return dp[bitmask];
 
	vis[bitmask] = 1;
 
	ll best = INF2;
 
	for(int submask : grafo[bitmask]){
		best = max(best, solve(bitmask ^ submask) + valor[submask] );
	}
 
	return dp[bitmask] = best;
 
}
 
int main() {
    FASTIO
    
    cin >> N;
	for(int i = 0;i<N;i++){
		for(int j = 0;j<N;j++){
			cin >> mat[i][j];
		}
	}
 
	brute(0,0,0);
	calcula();
 
    cout<<solve((1 << N) - 1);
    return 0;
}

Compiler output:
a.cc:32:1: error: 'tatic' does not name a type; did you mean 'static'?
   32 | tatic const lld nax=1e6+5;
      | ^~~~~
      | static
a.cc: In function 'll solve(int)':
a.cc:76:19: error: 'INF2' was not declared in this scope
   76 |         ll best = INF2;
      |                   ^~~~
Language: C++

16
0 5 -4 -5 -8 -4 7 2 -4 0 7 0 2 -3 7 7
5 0 8 -9 3 5 2 -7 2 -7 0 -1 -4 1 -1 9
-4 8 0 -9 8 9 3 1 4 9 6 6 -6 1 8 9
-5 -9 -9 0 -7 6 4 -1 9 -3 -5 0 1 2 -4 1
-8 3 8 -7 0 -5 -9 9 1 -9 -6 -3 -8 3 4 3
-4 5 9 6 -5 0 -6 1 -2 2 0 -5 -2 3 1 2
7 2 3 4 -9 -6 0 -2 -2 -9 -3 9 -2 9 2 -5
2 -7 1 -1 9 1 -2 0 -6 0 -6 6 4 -1 -7 8
-4 2 4 9 1 -2 -2 -6 0 8 -6 -2 -4 8 7 7
0 -7 9 -3 -9 2 -9 0 8 0 0 1 -3 3 -6 -6
7 0 6 -5 -6 0 -3 -6 -6 0 0 5 7 -1 -5 3
0 -1 6 0 -3 -5 9 6 -2 1 5 0 -2 7 -8 0
2 -4 -6 1 -8 -2 -2 4 -4 -3 7 -2 0 -9 7 1
-3 1 1 2 3 3 9 -1 8 3 -1 7 -9 0 -6 -8
7 -1 8 -4 4 1 2 -7 7 -6 -5 -8 7 -6 0 -9
7 9 9 1 3 2 -5 8 7 -6 3 0 1 -8 -9 0

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

#include<bits/stdc++.h>
using namespace std;
#define long long ll
int arr[(1<<17)];
int sum[(1<<17)];
ll calc(vector<vector<int>> &v1,int n){
  ll ans=0;
  for(int i=1;i<17;i++){
    for(int j=i+1;j<17;j++){
      if(mask&(1<<i)==1&&mask&(1<<j)==1)
        ans+=v1[i][j];
    }
  }
    return ans;
}
void produce(vector<vector<int>> &v1,int n){
  for(int i=1;i<(1<<n);i++)
    sum[i] = calc(v1,i);
}
ll solve(vector<vector<int>> &v1,int mask){
  if(mask==0) return 0;
  ll ans = 0;
  for(int sb = mask;sb!=0;sb=(sb-1)&mask){
    ans = max(solve[sb]+solve(v1,mask^sb,ans);
  }
  return ans;
}
int main(){
  int n;
  cin>>n;
  vector<vector<int>> v1(n);
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      cin>>v1[i][j];
    }
  }
  cout<<solve(v1,(1<<n)-1);
}

Compiler output:
a.cc:6:1: error: 'll' does not name a type
    6 | ll calc(vector<vector<int>> &v1,int n){
      | ^~
a.cc: In function 'void produce(std::vector<std::vector<int> >&, int)':
a.cc:18:14: error: 'calc' was not declared in this scope
   18 |     sum[i] = calc(v1,i);
      |              ^~~~
a.cc: At global scope:
a.cc:20:1: error: 'll' does not name a type
   20 | ll solve(vector<vector<int>> &v1,int mask){
      | ^~
a.cc: In function 'int main()':
a.cc:37:9: error: 'solve' was not declared in this scope
   37 |   cout<<solve(v1,(1<<n)-1);
      |         ^~~~~
Language: Java

import java.util.*;
import java.util.Map.Entry;

import hakerrank.solve_linear_equations;

import java.io.*;

public class Main {
static int mod=(int)1e9+7;
static long dp[];
static long score[];
public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n=scn.nextInt();
		long mat[][]=new long[n][n];
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				mat[i][j]=scn.nextLong();
			}
		}
		dp=new long[(1<<n)+1];
		Arrays.fill(dp, Integer.MIN_VALUE/2);
		score=new long[(1<<n)+1];
		for(int i=0;i<(1<<n);i++){
			long sc=0;
			for(int j=0;j<n;j++){
				for(int k=j+1;k<n;k++){
					if(((1<<j)&i)!=0 && ((1<<k)&i)!=0){
						sc+=mat[j][k];
					}
				}
			}
			score[i]=sc;
		}
		long ans=solve((1<<n)-1);
		System.out.println(ans);
		
		
		
		
		


	}
private static long solve(int mask) {
	if(mask==0){
		return 0;
	}
	if(dp[mask]!=Integer.MIN_VALUE/2){
		return dp[mask];
	}

	long res=0;

	for(int submask=mask;submask!=0;submask=(submask-1)&mask){
		
		res=Math.max(res, score[submask]+solve(submask^mask));
	}
	
	
	
	return dp[mask]=res;
}

}

Compiler output:
Main.java:4: error: package hakerrank does not exist
import hakerrank.solve_linear_equations;
                ^
1 error
Language: C++

    #include <bits/stdc++.h>
    #include <ctime >

    using namespace std;

    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define FOR(i,a,b) for(int i = (a); i < (b); i++)
    #define rep(i,n) FOR(i,0,n)
    #define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); --i)
    #define SZ(a) (int)a.size()
    #define ALL(a) a.begin(),a.end()
    #define PB push_back

    typedef long long LL;

    const double PI = acos(-1.0);
    const int INF = 1000 * 1000 * 1000 + 7;
    const LL LINF = INF * (LL)INF;
    const int MAS =4e5; //5;
    const int MOD = 1e9 + 7;
    const double EPS = 1e-8;


    vector<LL> pre ;
    vector<LL >dp;
    // O( 2^ n)
    void rec(int idx, const vector<int > &not_taken ,int score,int mask, int group)
    {
        if (idx == not_taken.size())
        {
         dp[mask] = max(dp[mask],score  + pre[group]);
         return ;
        }
        rec(idx+1, not_taken , score,mask,group);
        rec(idx+1,not_taken , score,mask ^(1  << not_taken[idx]),group  ^ (1 << not_taken[idx ]));

    }
    int main() {
        IOS

    //    srand(time(0));
        //   freopen("series.in","r",stdin);
        //   freopen("series.out","w",stdout);
        int n;
        cin >> n;
        vector<vector<LL >>  a (n,vector<LL > (n))  ;
        rep(i,n) {
            rep(j, n)
            {
                cin >> a[i][j] ;
             }
        }
        pre.resize(1 << n);
       //  O(2^n * n ^ 2)
        rep(msk,(1 << n ))
        {
            rep(i,n)
            {
                if(msk & ( 1 <<i))
                {
                    for(int j =  i + 1; j < n ; j ++)
                    {
                        if(msk  & ( 1 << j))
                        {
                            pre[msk]+=a[i][j] ;
                        }
                    }
                }
            }
        }
        //O(n^2 * n )
        dp.resize(1 << n,-LINF );
        dp[0] = 0 ;
        rep(msk,(1 << n ))
        {
            vector<int> not_taken;
            rep(i,n)
            {
                if(!(msk & ( 1 << i)))
                {
                    not_taken.PB(i);
                }
            }
            rec(0,not_taken,dp[msk],msk,0);

        }
        cout << dp[(1 << n )- 1] << endl;
    //    cout << "runtime = " << clock()/1000.0 << endl;



    }

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

    #include <bits/stdc++.h>
    #include <ctime >

    using namespace std;

    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define FOR(i,a,b) for(int i = (a); i < (b); i++)
    #define rep(i,n) FOR(i,0,n)
    #define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); --i)
    #define SZ(a) (int)a.size()
    #define ALL(a) a.begin(),a.end()
    #define PB push_back

    typedef long long LL;

    const double PI = acos(-1.0);
    const int INF = 1000 * 1000 * 1000 + 7;
    const LL LINF = INF * (LL)INF;
    const int MAS =4e5; //5;
    const int MOD = 1e9 + 7;
    const double EPS = 1e-8;


    vector<LL> pre ;
    vector<LL >dp;
    // O( 2^ n)
    void rec(int idx, vector<int > not_taken ,int score,int mask, int group)
    {
        if (idx == not_taken.size())
        {
         dp[mask] = max(dp[mask],score  + pre[group]);
         return ;
        }
        rec(idx+1, not_taken , score,mask,group);
        rec(idx+1,not_taken , score,mask ^(1  << not_taken[idx]),group  ^ (1 << not_taken[idx ]));

    }
    int main() {
        IOS

        srand(time(0));
        //   freopen("series.in","r",stdin);
        //   freopen("series.out","w",stdout);
        int n;
        cin >> n;
        vector<vector<LL >>  a (n,vector<LL > (n))  ;
        rep(i,n) {
            rep(j, n)
            {
                cin >> a[i][j] ;
             }
        }
        pre.resize(1 << n);
       //  O(2^n * n ^ 2)
        rep(msk,(1 << n ))
        {
            rep(i,n)
            {
                if(msk & ( 1 <<i))
                {
                    for(int j =  i + 1; j < n ; j ++)
                    {
                        if(msk  & ( 1 << j))
                        {
                            pre[msk]+=a[i][j] ;
                        }
                    }
                }
            }
        }
        //O(n^2 * n )
        dp.resize(1 << n,-LINF );
        dp[0] = 0 ;
        rep(msk,(1 << n ))
        {
            vector<int> not_taken;
            rep(i,n)
            {
                if(!(msk & ( 1 << i)))
                {
                    not_taken.PB(i);
                }
            }
            rec(0,not_taken,dp[msk],msk,0);

        }
        cout << dp[(1 << n )- 1] << endl;
       //cout << "runtime = " << clock()/1000.0 << endl;



    }

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

/**
 *    author:  tourist
 *    created: 24.12.2019 19:44:51       
 *    just for test
**/
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<vector<int>> a(n, vector<int>(n));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  vector<long long> sub(1 << n);
  for (int t = 1; t < (1 << n); t++) {
    int i = 0;
    while (!(t & (1 << i))) {
      ++i;
    }
    sub[t] = sub[t ^ (1 << i)];
    for (int j = i + 1; j < n; j++) {
      if (t & (1 << j)) {
        sub[t] += a[i][j];
      }
    }
  }
  vector<long long> dp(1 << n);
  for (int t = 1; t < (1 << n); t++) {
    int u = nt;
    while (true) {
      dp[t] = max(dp[t], dp[t  ^ u] + sub[u]);
      if (u == 0) {
        break;
      }
      u = (u - 1) & nt;
    }
  }
  cout << dp.back() << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: 'nt' was not declared in this scope; did you mean 't'?
   36 |     int u = nt;
      |             ^~
      |             t
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;

ll dp[(1<<17)];
ll a[17][17], n;

ll score[(1<<17)]

ll calc_group(ll x) {
	ll score = 0LL;
	for(int i=0;i<n;i++) {
		if(x&(1<<i))
			for(int j=0;j<n;j++)
				if(x&(1<<j) && i < j) 
					score += a[i][j]; 
	}
	return score;
}	

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

	for(ll mask=1LL;mask<(1<<n);mask++) {
		score[mask] = calc_group(mask);
	}

	for(ll mask=1LL;mask<(1<<n);mask++) {
		ll x = mask;
		int b = 0; 
		do {
        	dp[mask] = max(dp[mask], dp[mask^b] + score[b]);
		} while (b=(b-x)&x);
	}
	cout<<dp[(1<<n)-1];
}

Compiler output:
a.cc:2:12: error: expected initializer before 'long'
    2 | #define ll long long
      |            ^~~~
a.cc:12:1: note: in expansion of macro 'll'
   12 | ll calc_group(ll x) {
      | ^~
a.cc: In function 'int main()':
a.cc:32:17: error: 'score' was not declared in this scope
   32 |                 score[mask] = calc_group(mask);
      |                 ^~~~~
a.cc:32:31: error: 'calc_group' was not declared in this scope
   32 |                 score[mask] = calc_group(mask);
      |                               ^~~~~~~~~~
a.cc:39:55: error: 'score' was not declared in this scope
   39 |                 dp[mask] = max(dp[mask], dp[mask^b] + score[b]);
      |                                                       ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int n;
int a[25][25];
ll power[(1<<16)];
ll dp[(1<<16)],ans[(1<<16)];
int main(){
	cin>>n;
	for(int i=0;i<n;++i){
		power[(1<<i)]=i;
	}
	for(int i=0;i<n;++i){
		for(int j=0;j<n;++j){
			cin>>a[i][j];
		}
	}
	for(int i=0;i<(1<<n);++i){
		ll lb=(i&(-i)),x=power[lb],st=i^lb;
		dp[i]=dp[st];
		for(int j=0;j<n;++j){
			if((1<<j)&t){
				dp[i]+=a[j][x];
			}
		}
	}
	for(int i=1;i<(1<<n);++i){
		for(int j=i;j;j=((j-1)&i)){
			ans[i]=max(ans[i],dp[j]+dp[i^j]);
		}
	} 
	cout<<ans[(1<<n)-1]<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:35: error: 't' was not declared in this scope
   22 |                         if((1<<j)&t){
      |                                   ^
Language: C++

#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

ll n,a[22][22],dp[(1<<18)];
int main(){
    cin>>n;
    for(int i=0;i<n;i++)for(int j=0;j<n;j++)cin>>a[i][j];
    for(int i=0;i<(1<<n);i++)for(int j=0;j<n;j++){
        if(((i>>j)&1)==1){
            dp[i]=dp[i-(1<<j)];
            for(int k=0;k<n;k++)if(((i>>k)&1)==1)dp[i]+=a[j][k];
        }
    }
    for(int i=0;i<(1<<n);i++)for(int j=i;j;j=(j-1)&i){dp[i]=max(dp[i],dp[j]+dp[i^j]);
    cout<<dp[(1<<n)-1]<<endl;
    return 0;
}

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

#include<cstdio>

int main(){
  int n;
  cin >> n;
  if(n==1) while(1){}
  printf("0\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~