criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;

/**
 * Created by Harry on 3/29/20.
 */
public class KnapsackForAllSegments_ABC159_F {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int target = scanner.nextInt();
        int[] nums = new int[n];
        for(int i=0; i<n; i++){
            nums[i] = scanner.nextInt();
        }
        System.out.print(calc(n, target, nums));
    }

    public static int calc(int n, int target, int[] nums){
        int[][][] dp = new int[n][n][target+1];
        int mod = 998244353;
        for(int j=0; j<n; j++){
            for(int i=j; i>=0; i--){
                if(i==j){
                    if(nums[j]<=target){
                        dp[i][j][nums[j]]=1;
                    }
                    dp[i][j][0] = 1;
                }
                else{
                    dp[i][j][0] = 1;
                    for(int k=1; k<=target; k++){
                        dp[i][j][k] = (dp[i][j][k]+(k-nums[j] >=0 ? dp[i][j-1][k-nums[j]] : 0)+dp[i][j-1][k])%mod;
                    }
                }
//                System.out.println(i+","+j+","+dp[i][j][target]);
            }
        }
        long res = 0;
        for(int j=0; j<n; j++){
            for(int i=0; i<=j; i++){
                int count = 0;
                if(i==j){
                    count = dp[i][j][target];

                }
                else{
                    if(target-nums[i]-nums[j]<0){
                        count = 0;
                    }
                    else if(target-nums[i]-nums[j]==0){
                        count = i+1>j-1 ? 1 : dp[i+1][j-1][0];
                    }
                    else{
                        count = i+1>j-1 ? 0 : dp[i+1][j-1][target-nums[i]-nums[j]];
                    }
                }
//                System.out.println(i+","+j+","+count);
                res = (res+ (i+1)*(n-j)*count%mod)%mod;
            }
        }
        return (int)res;
    }
}


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

include <bits/stdc++.h>
#define N 3005
 
using namespace std;
 
const int mod = 998244353;
 
int n, S;
int a[N], f[N];
 
int main() {
	scanf("%d %d", &n, &S);
	for(int i = 1; i <= n; ++i)
		scanf("%d", &a[i]);
	
	int ans = 0;
	for(int i = 1; i <= n; ++i) {
		if(a[i] > S) continue;
		else if(a[i] == S) {
			ans = (ans + 1LL * i * (n - i + 1)) % mod;
		} else {
			ans = (ans + 1LL * f[S - a[i]] * (n - i + 1)) % mod;
			for(int j = S; j > a[i]; --j)
				(f[j] += f[j - a[i]]) %= mod;
			f[a[i]] = (f[a[i]] + i) % mod;
		}
	}
	
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf' was not declared in this scope
   12 |         scanf("%d %d", &n, &S);
      |         ^~~~~
a.cc:29:9: error: 'printf' was not declared in this scope
   29 |         printf("%d\n", ans);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include <bits/stdc++.h>
Language: C++

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#define mm(a,x) memset(a,x,sizeof(a))
#define sync std::ios::sync_with_stdio(false);std::cin.tie(0)
#define ll long long
using namespace std;
const int MAXN=3e3+10;
const int MOD=998244353;
int a[MAXN];
ll dp[MAXN];
int main(void)
{
    sync;
    int n,s;
    cin>>n>>s;
    for(int i=1;i<=n;++i)
        cin>>a[i];
    int res=0;
    for(int i=1;i<=n;++i)
    {
        for(int j=s;j>a[i];--j)
            dp[j]=(dp[j]+dp[j-a[i]])%MOD:
        dp[a[i]]=(dp[a[i]]+i)%MOD;
        res=(res+(n-i+1)*dp[s]%MOD)%MOD;
        dp[s]=0;
    }
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:41: error: found ':' in nested-name-specifier, expected '::'
   24 |             dp[j]=(dp[j]+dp[j-a[i]])%MOD:
      |                                         ^
      |                                         ::
a.cc:24:38: error: 'MOD' is not a class, namespace, or enumeration
   24 |             dp[j]=(dp[j]+dp[j-a[i]])%MOD:
      |                                      ^~~
Language: C++

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,tune=native")
// #pragma comment(linker, "/stack:200000000"]
 
#include <iostream>
#include <vector>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <stack>
#include <random>
#include <fstream>
#include <sstream>
 
#define fr first
#define se second
#define pb push_back
#define ll long long
#define ld long double
#define hm unordered_map 
#define pii pair<int, int>
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define cinv(v) for (auto& x: v) cin >> x
#define forn(i, n) for (int i = 0; i < n; ++i)
#define forln(i, l, n) for (int i = l; i < n; ++i)

#define int ll

using namespace std;

#ifdef __LOCAL
	#define dbg(x) cerr << #x << " : " << x << '\n'
	const int maxn = 20;
#else 
	#define dbg(x)
	const int maxn = 2e5 + 20;
#endif

//tg: @galebickosikasa
 
const ll inf = (ll) 2e9;
const ld pi = 3.14159265358979323846264;
const ld eps = 1e-8;
const ll mod = 998244353;
const ll ns = 97;

random_device rd;
mt19937 SuperRandom(rd());



signed main () {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int n, s;
	cin >> n >> s;
	vector<int> goo (n);
	cinv (goo);
	vector<vector<int>> dp (n + 1, vector<int> (s + 10));
	// dp[0][0] = 1;
	int ans = 0;
	for (int i = 1; i <= n; ++i) {
		int x = goo[i - 1];
		dp[i][x] += i;
		dp[i]x] %= mod;
		for (int j = s; j >= 0; --j) {
			dp[i][j] += dp[i - 1][j];
			dp[i][j] %= mod;
			if (dp[i - 1][j] && j + x <= s) {
				dp[i][j + x] += dp[i - 1][j];
				dp[i][j + x] %= mod;
			}
		}
		ans += dp[i][s];
		ans %= mod;
	}
	cout << ans;









}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:22: error: expected ';' before 'x'
   74 |                 dp[i]x] %= mod;
      |                      ^
      |                      ;
a.cc:74:21: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; reference = std::vector<long long int>&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   74 |                 dp[i]x] %= mod;
      |                     ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>
#include <random>
#include <bitset>
#include <chrono>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

#define DEBUG
#ifdef DEBUG
#include "debug.h"
#else
#define debug(...) 42
#endif

const int M = 8e3+1;
const int MD=998244353;

int a[M];
ll dp[M][M],ans=0,pre[M][M];
int main() {
	fast_cin();
    int n,s;
	cin>>n>>s;	
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	for(int i=1;i<=n;i++){
		for(int j=0;j<=s;j++){
			if(j==0){
				dp[i][j+a[i]]=i;
			}
			else{
				dp[i][j+a[i]]=(dp[i][j+a[i]]+pre[i-1][j])%MD;
			}
		}
		for(int j=0;j<=s;j++){
			pre[i][j]=(pre[i-1][j]+dp[i][j])%MD;
		}
	}
	for(int i=1;i<=n;i++){
		ans=(ans+((n-i+1)*dp[i][s])%MD)%MD;
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:32:10: fatal error: debug.h: No such file or directory
   32 | #include "debug.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>
#include <random>
#include <bitset>
#include <chrono>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

#define DEBUG
#ifdef DEBUG
#include "debug.h"
#else
#define debug(...) 42
#endif

const int M = 4e3+1;
const int MD=998244353;

int a[M];
ll dp[M][M],ans=0,pre[M][M];
int main() {
	fast_cin();
    int n,s;
	cin>>n>>s;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	for(int i=1;i<=n;i++){
		for(int j=0;j<=s;j++){
			if(j==0){
				dp[i][j+a[i]]=i;
			}
			else{
				dp[i][j+a[i]]=(dp[i][j+a[i]]+pre[i-1][j])%MD;
			}
		}
		for(int j=0;j<=s;j++){
			pre[i][j]=(pre[i-1][j]+dp[i][j])%MD;
		}
	}
	for(int i=1;i<=n;i++){
		ans=(ans+((n-i+1)*dp[i][s])%MD)%MD;
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:32:10: fatal error: debug.h: No such file or directory
   32 | #include "debug.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

//testing penalty
/* making this source code 50 characters long */

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
 
using namespace std;
using ll = long long;

void Main(){
    ll n, s, i, j;
    cin >> n >> s;
    vector<ll> a(n);
    for (i=0; i<n; i++){
        cin >> a.at(i);
    }
    vector<vector<ll>> t(n, vector<ll>(s+1));
    for (ll i=0; i<n; i++){
        t[i][0] = i+2;        
    }
    if (a[0] <= s){
        t[0][a[0]] = 1;
    }
    for (i=1; i<n; i++){
        for (j=1; j<s+1; j++){
            t[i][j] = t[i-1][j];
            if (j - a[i] >= 0){
                t[i][j] += t[i-1][j-a[i]];
            }
        }
    }
    ll sum = 0;
    for (vector<ll> v: t){
        // for (ll x : v){
        //     cout << x;
        // }
        // cout << endl;
        sum += v[s];
        sum = sum % 998244353;
    }
    cout << sum;
}

ll main(void){
    std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
    Main();
}

Compiler output:
a.cc:41:1: error: '::main' must return 'int'
   41 | ll main(void){
      | ^~
Language: C++

#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
typedef long long ll;
int p = 998244353, dp[3010], n, s, ans, x[3010];
int main()
{
    int n, s;
    scanf("%d%d", &n, &s);
    ll ans = 0;
    for (int i = 1; i <= n; ++i)
    {
        scanf("%d", &x[i]);
        dp[0] = i;
        for (int j = s; j >= x[i]; --j)
            dp[j] = (dp[j] + dp[j - x]) % p;
        ans = (ans + dp[s]) % p;
    }
    cout << ans << endl;
    return 0;
}
// #include <cstdio>
// int p = 998244353, dp[3010], n, s, ans, x[3010];
// int main()
// {
//     scanf("%d%d", &n, &s);
//     for (int i = 1; i <= n; ++i)
//     {
//         scanf("%d", &x[i]);
//         dp[0] = i;
//         for (int j = s; j >= x[i]; --j)
//             dp[j] += dp[j - x[i]];
//         ans = (ans + dp[s]);
//     }
//     printf("%d", ans);
//     return 0;
// }

Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: invalid operands of types 'int' and 'int [3010]' to binary 'operator-'
   17 |             dp[j] = (dp[j] + dp[j - x]) % p;
      |                                 ~ ^ ~
      |                                 |   |
      |                                 int int [3010]
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
  int n, s;
  cin >> n >> s;
  vector<int> a(n);
  REP(i, n) cin >> a[i];
  vector<mint> q(s+1);
  mint ans = 0;
  REP(i, n) {
    q[0] += 1;

    vector<mint> q2(s+1);
    REP(j, s+1) {
      q2[j] += q[j];
      if (j+a[i] <= s) q2[j+a[i]] += q[j];
    }
    q = q2;

    ans += q[s];
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: 'mint' was not declared in this scope; did you mean 'uint'?
   22 |   vector<mint> q(s+1);
      |          ^~~~
      |          uint
a.cc:22:14: error: template argument 1 is invalid
   22 |   vector<mint> q(s+1);
      |              ^
a.cc:22:14: error: template argument 2 is invalid
a.cc:23:7: error: expected ';' before 'ans'
   23 |   mint ans = 0;
      |       ^~~~
      |       ;
a.cc:25:6: error: invalid types 'int[int]' for array subscript
   25 |     q[0] += 1;
      |      ^
a.cc:27:16: error: template argument 2 is invalid
   27 |     vector<mint> q2(s+1);
      |                ^
a.cc:29:9: error: invalid types 'int[int]' for array subscript
   29 |       q2[j] += q[j];
      |         ^
a.cc:29:17: error: invalid types 'int[int]' for array subscript
   29 |       q2[j] += q[j];
      |                 ^
a.cc:30:26: error: invalid types 'int[int]' for array subscript
   30 |       if (j+a[i] <= s) q2[j+a[i]] += q[j];
      |                          ^
a.cc:30:39: error: invalid types 'int[int]' for array subscript
   30 |       if (j+a[i] <= s) q2[j+a[i]] += q[j];
      |                                       ^
a.cc:34:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |     ans += q[s];
      |     ^~~
      |     abs
a.cc:34:13: error: invalid types 'int[int]' for array subscript
   34 |     ans += q[s];
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll p=998244353ll;
ll fun(vector<int> &vec,vector<vector<vector<ll>>> &dp, bool selected,int index,ll sum)
{
	int n=vec.size();
	if(sum<0)
		return 0;
	if(sum==0)
	{
		return index+2;
	}

	if(index==0)
	{
		if(vec[index]==sum)
			return 1;
		else
			return  0;
	}

	if(selected)
	{
		if(dp[index][sum][1]!=-1)
		{
			return dp[index][sum][1];
		}
		
		dp[index][sum][1] = fun(vec,dp,true,index-1,sum)+fun(vec,dp,true,index-1,sum-vec[index]);
		dp[index][sum][1]%=p;
		return dp[index][sum][1];
	}
	else
	{
		if(dp[index][sum][0]!=-1)
		{
			return dp[index][sum][0];
		}
		
		dp[index][sum][0] = fun(vec,dp,false,index-1,sum)+(fun(vec,dp,true,index-1,sum-vec[index])*(n-index))%p;
		dp[index][sum][0]%=p;
		return dp[index][sum][0];
	}
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,s;
    cin>>n>>s;
    vector<ll> vec(n);
    for(int i=0;i<n;++i)
    {
    	cin>>vec[i];
    }

    vector<vector<vector<ll>>> dp(n,vector<vector<ll>>(3000,vector<ll>(2,-1)));
    ll ans=fun(vec,dp,false,n-1,s);
    cout<<ans<<"\n";

}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:16: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>'
   59 |     ll ans=fun(vec,dp,false,n-1,s);
      |                ^~~
a.cc:5:21: note: in passing argument 1 of 'll fun(std::vector<int>&, std::vector<std::vector<std::vector<long long int> > >&, bool, int, ll)'
    5 | ll fun(vector<int> &vec,vector<vector<vector<ll>>> &dp, bool selected,int index,ll sum)
      |        ~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll p=998244353ll;
ll fun(vector<int> &vec,vector<vector<vector<ll>>> &dp, bool selected,int index,ll sum)
{
	if(sum<0)
		return 0;
	if(sum==0)
	{
		return index+2;
	}

	if(index==0)
	{
		if(vec[index]==sum)
			return 1;
		else
			return  0;
	}

	if(selected)
	{
		if(dp[index][sum][1]!=-1)
		{
			return dp[index][sum][1];
		}
		
		dp[index][sum][1] = fun(vec,dp,true,index-1,sum)+fun(vec,dp,true,index-1,sum-vec[index]);
		dp[index][sum][1]%=p;
		return dp[index][sum][1];
	}
	else
	{
		if(dp[index][sum][0]!=-1)
		{
			return dp[index][sum][0];
		}
		
		dp[index][sum][0] = fun(vec,dp,false,index-1,sum)+(fun(vec,dp,true,index-1,sum-vec[index])*(n-index))%p;
		dp[index][sum][0]%=p;
		return dp[index][sum][0];
	}
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,s;
    cin>>n>>s;
    vector<int> vec(n);
    for(int i=0;i<n;++i)
    {
    	cin>>vec[i];
    }

    vector<vector<vector<ll>>> dp(n,vector<vector<ll>>(3000,vector<ll>(2,-1)));
    ll ans=fun(vec,dp,false,n-1,s);
    cout<<ans<<"/n";

}


Compiler output:
a.cc: In function 'll fun(std::vector<int>&, std::vector<std::vector<std::vector<long long int> > >&, bool, int, ll)':
a.cc:40:109: error: 'n' was not declared in this scope; did you mean 'yn'?
   40 |                 dp[index][sum][0] = fun(vec,dp,false,index-1,sum)+(fun(vec,dp,true,index-1,sum-vec[index])*(n-index))%p;
      |                                                                                                             ^
      |                                                                                                             yn
Language: C++

#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
#include<queue>
#include<vector>
#include<set>
#include<sstream>
using namespace std;
typedef long long ll;
const ll maxn=1e6+10;
const ll inf=0x3f3f3f3f3f3f3f3f;
void io(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
ll a[maxn],dp[maxn];
int main()
{
	io();
	ll n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++) cin>>a[i]; 
	ll ans=0;
	for(int i=0;i<n;i++)
	{
		dp[0]+=1;
		for(int j=k;j>=a[i];j--)
			if(j+a[i]<=s) dp[j+a[i]]+=dp[j];
		ans+=dp[k];
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:36: error: 's' was not declared in this scope
   26 |                         if(j+a[i]<=s) dp[j+a[i]]+=dp[j];
      |                                    ^
Language: C++

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

using ll = long long;
const ll mod = 998244353;


ll dp[3030][3030][3];
int a[3030];
int main(){
  int n, k;
  cin >> n >> k;
  for(int i=0;i<n;i++)cin >> a[i];
  dp[0][0][0] = 1;
  for(int i=0;i<n;i++){
    for(int j=0;j<=k;j++){
      tmp = (j == 0);
      (dp[i+1][j][1] += tmp + dp[i][j][1]) %= mod;
      (dp[i+1][j][2] += tmp + dp[i][j][1] + dp[i][j][2]) %= mod;
      if(j + a[i] <= k){
        (dp[i+1][j+a[i]][1] += tmp + dp[i][j][1]) %= mod;
        (dp[i+1][j+a[i]][2] += tmp + dp[i][j][1]) %= mod;
      }
    }
  }
  cout << dp[n][k][2] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   17 |       tmp = (j == 0);
      |       ^~~
      |       tm
Language: C++

    #include<iostream>
    using namespace std;
     
    using ll = long long;
    const ll mod = 998244353;
     
     
    ll dp[3030][3030][3];
    int a[3030];
    int main(){
        int n, k;
        cin >> n >> k;
        for(int i=0;i<n;i++)cin >> a[i];
        dp[0][0][0] = 1;
        for(int i=0;i<n;i++){
            for(int j=0;j<=k;j++){
                (dp[i+1][j][0] += dp[i][j][0]) %= mod;
                assert(dp[i + 1][j][0] <= 1);
                (dp[i+1][j][1] += dp[i][j][0] + dp[i][j][1]) %= mod;
                (dp[i+1][j][2] += dp[i][j][0] + dp[i][j][1] + dp[i][j][2]) %= mod;
                if(j + a[i] <= k){
                    (dp[i+1][j+a[i]][1] += dp[i][j][0] + dp[i][j][1]) %= mod;
                    (dp[i+1][j+a[i]][2] += dp[i][j][0] + dp[i][j][1]) %= mod;
                }
            }
        }
        cout << dp[n][k][2] << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'assert' was not declared in this scope
   18 |                 assert(dp[i + 1][j][0] <= 1);
      |                 ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 |     #include<iostream>
  +++ |+#include <cassert>
    2 |     using namespace std;
Language: C++

#include <bits/stdc++.h>
#define LL long long
using namespace std;
LL sum;
int a[3010], n, s;
LL dp[3010];
void add(LL &x, LL y){
  x += y;
  if (x >= 998244353) x -= 998244353;
}
int main(){
  	cin>>n>>s;
  	for (int i=1;i<=n;i++) cin>>a[i];
  	sum = 0;
  	int now = 0;
  	for (int i=1;i<=n;i++){
        now += a[i];
      	if (now > s) now = s
    	dp[0] = i;
      	if (a[i]>s) continue;
      	add(sum, dp[s-a[i]] * (n-i+1)); 
      	for (int j=now-a[i]; j>=0; j--) add(dp[j+a[i]], dp[j]);
    }
  	cout<<sum<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:29: error: expected ';' before 'dp'
   18 |         if (now > s) now = s
      |                             ^
      |                             ;
   19 |         dp[0] = i;
      |         ~~
Language: C++

#include <bits/stdc++.h>
#define LL long long
using namespace std;
LL sum;
int a[3010], n, s;
LL dp[3010];
void add(LL &x, LL y){
  x += y;
  if (x >= 998244353) x -= 998244353;
}
int main(){
  	cin>>n>>s;
  	for (int i=1;i<=n;i++) cin>>a[i];
  	sum = 0;
  	now = 0;
  	for (int i=1;i<=n;i++){
        now += a[i];
      	if (now > s) now = s
    	dp[0] = i;
      	if (a[i]>s) continue;
      	add(sum, dp[s-a[i]] * (n-i+1)); 
      	for (int j=now-a[i]; j>=0; j--) add(dp[j+a[i]], dp[j]);
    }
  	cout<<sum<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'now' was not declared in this scope; did you mean 'pow'?
   15 |         now = 0;
      |         ^~~
      |         pow
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define re register
#define pb push_back
#define fi first
#define se second
#define mp make_pair
const int N=2e6+10;
const int mod1=998244353;
const int mod2=19260811;
void read(int &a)
{
    a=0;int d=1;char ch;
    while(ch=getchar(),ch>'9'||ch<'0')
        if(ch=='-')
            d=-1;
    a=ch^48;
    while(ch=getchar(),ch>='0'&&ch<='9')
        a=(a<<3)+(a<<1)+(ch^48);
    a*=d;
}
int f[N];
int main()
{
    int n,m,ans=0;
    read(n),read(m);
    for(re int i=1;i<=n;i++)
    {
        f[0]++;
        for(re int j=m;j>=a[i];j--)
        {
            f[j]+=f[j-a[i]];
            f[j]%=mod;
        }
        ans+=f[m];
        ans%=mod;
    }
    printf("%d",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   29 |     for(re int i=1;i<=n;i++)
      |                ^
a.cc:32:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   32 |         for(re int j=m;j>=a[i];j--)
      |                    ^
a.cc:32:27: error: 'a' was not declared in this scope
   32 |         for(re int j=m;j>=a[i];j--)
      |                           ^
a.cc:35:19: error: 'mod' was not declared in this scope; did you mean 'modf'?
   35 |             f[j]%=mod;
      |                   ^~~
      |                   modf
a.cc:38:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
   38 |         ans%=mod;
      |              ^~~
      |              modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
constexpr int MOD = 998244353;
int n, s, a;
long long dp[3005], ans;
int main(){
	scanf("%d%d", &n, &s);
	rep(i,n){
		scanf("%d", &a);
		for(int j=s; j>a; j--) (dp[j] += dp[j-a]) %= MOD;
		dp[a] += i+1;
      dp[s]%=mod;
		/*(ans += dp[s]) %= MOD;
      	dp[s]+=*/
	}
	printf("%lld\n", dp[s]%mod);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
   13 |       dp[s]%=mod;
      |              ^~~
      |              modf
a.cc:17:32: error: 'mod' was not declared in this scope; did you mean 'modf'?
   17 |         printf("%lld\n", dp[s]%mod);
      |                                ^~~
      |                                modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
ll ans = 0;
const ll mo = 998244353;
auto mod = [](ll modx) {modx%=mo;modx+=mo;modx%=mo;return modx; };

int main()
{
ll n , s ;
cin >> n >> s ;
vector<ll> a(n);
rep(i, n){
  cin >> a[i];
}
ll dp[n+1][s+1][3]={};
dp[0][0][0]=1;
rep(i,n)rep(j,s+1)rep(k,3){
  dp[i+1][j][k]+=dp[i][j][k] %=mod;
  if(k!=2){
    dp[i+1][j][k+1]+=dp[i][j][k] %=mod;
  }
  if(j+a[i]<=s&&k==0){
    dp[i+1][j+a[i]][k+1]+=dp[i][j][k] %=mod;
  }
  if(j+a[i]<=s&&k==1){
    dp[i+1][j+a[i]][k]+=dp[i][j][k] %=mod;
    dp[i+1][j+a[i]][k+1]+=dp[i][j][k] %=mod;
  }
}
cout << dp[n][s][2] << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: no match for 'operator%=' (operand types are 'll' {aka 'long long int'} and '<lambda(ll)>')
   20 |   dp[i+1][j][k]+=dp[i][j][k] %=mod;
      |                  ~~~~~~~~~~~~^~~~~
a.cc:22:34: error: no match for 'operator%=' (operand types are 'll' {aka 'long long int'} and '<lambda(ll)>')
   22 |     dp[i+1][j][k+1]+=dp[i][j][k] %=mod;
      |                      ~~~~~~~~~~~~^~~~~
a.cc:25:39: error: no match for 'operator%=' (operand types are 'll' {aka 'long long int'} and '<lambda(ll)>')
   25 |     dp[i+1][j+a[i]][k+1]+=dp[i][j][k] %=mod;
      |                           ~~~~~~~~~~~~^~~~~
a.cc:28:37: error: no match for 'operator%=' (operand types are 'll' {aka 'long long int'} and '<lambda(ll)>')
   28 |     dp[i+1][j+a[i]][k]+=dp[i][j][k] %=mod;
      |                         ~~~~~~~~~~~~^~~~~
a.cc:29:39: error: no match for 'operator%=' (operand types are 'll' {aka 'long long int'} and '<lambda(ll)>')
   29 |     dp[i+1][j+a[i]][k+1]+=dp[i][j][k] %=mod;
      |                           ~~~~~~~~~~~~^~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;
  
int main() {
  int n, s, mod(998244353);
  cin >> n >> s;
  int arr[n];
  for (int i = 0; i < n; ++i) cin >> arr[i];
  long long ans(0);
  vector<long long> dp(s + 1);
  
  for (int i = 0; i < n; ++i) {
    long long prev(dp[s]);
    for (int j = s; j >= 0; --j) {
      if ((dp[j] || j == 0) && j + arr[i] <= s) {
        dp[j + arr[i]] += j == 0 ? i + 1 : dp[j];
        dp[j + arr[i]] %= mod;
      }
    }
    ans += (dp[s] + mod - t) * (n - i);
    ans %= mod;
  }
  
  cout << ans << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: 't' was not declared in this scope
   21 |     ans += (dp[s] + mod - t) * (n - i);
      |                           ^
Language: C++

        #include<iostream>
        #include<bits/stdc++.h>
        using namespace std;
        #define size 3000
        #define NUM 998244353
        #define ll long long int
    	int arr[size];
         
        int main()
        {
          int n,s;
          for(int i=0;i<n;i++)
            cin>>arr[i];
          dp[n][s+1];
          for(int i=0;i<n;i++)
          {
            for(int j=0;j<=s;j++)
            {
              if(i==0)
              {
                if(s==arr[i])
                  dp[i][j]=1;
                else
                  dp[i][j]=0;
              }
              else if(s==0)
              {
                dp[i][j]=0;
              }
              else
              {
                if(j>=arr[i])
                	dp[i][j]=dp[i-1][j]+dp[i-1][j-arr[i]];
                else
                  dp[i][j]=dp[i-1][j];
              }
            }
          }
          ll ans=0;
          for(int l=0;l<n;l++)
          {
            for(int r=l;r<n;r++)
            {
              if(l==0)
                ans=(ans+dp[r][j])%NUM;
              else
                ans=(ans+dp[r][s]-dp[l-1][s])%NUM;
            }
          }
          cout<<ans%NUM<<endl;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'dp' was not declared in this scope; did you mean 'dup'?
   14 |           dp[n][s+1];
      |           ^~
      |           dup
a.cc:45:32: error: 'j' was not declared in this scope
   45 |                 ans=(ans+dp[r][j])%NUM;
      |                                ^
Language: C++

    #include<iostream>
    #include<bits/stdc++.h>
    using namespace std;
    #define size 3000
    #define NUM 998244353
    #define ll long long int
	int arr[size];
     
    int main()
    {
      int n,s;
      for(int i=0;i<n;i++)
        cin>>arr[i];
      dp[n][s+1];
      for(int i=0;i<n;i++)
      {
        for(int j=0;j<=s;j++)
        {
          if(i==0)
          {
            if(s==arr[i])
              dp[i][j]=1;
            else
              dp[i][j]=0;
          }
          else if(s==0)
          {
            dp[i][j]=0;
          }
          else
          {
            if(j>=arr[i])
            	dp[i][j]=dp[i-1][j]+dp[i-1][j-arr[i]];
            else
              dp[i][j]=dp[i-1][j];
          }
        }
      }
      ll ans=0;
      for(int l=0;l<n;l++)
      {
        for(int r=l;r<n;r++)
        {
          if(l==0)
            ans+=dp[r][j];
          else
            ans+=dp[r][s]-dp[l-1][s];
        }
      }
      cout<<ans<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'dp' was not declared in this scope; did you mean 'dup'?
   14 |       dp[n][s+1];
      |       ^~
      |       dup
a.cc:45:24: error: 'j' was not declared in this scope
   45 |             ans+=dp[r][j];
      |                        ^
a.cc:50:23: error: expected '}' at end of input
   50 |       cout<<ans<<endl;
      |                       ^
a.cc:10:5: note: to match this '{'
   10 |     {
      |     ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int main()
{
 
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll n,s;
  cin>>n>>s;
  ll arr[n],i,ans,sum1=0,sum[n],j;
  for(i=0;i<n;i++)
  {
      cin>>arr[i];
  }
  for(i=0;i<n;i++)
  {
      sum1=sum1+arr[i];
      sum[i]=sum1;
  }
  for(i=0;i<n;i++)
  {
      for(j=i;j<n;j++)
      {
          if(sum[j]-sum[i]+arr[i]==s)
          ans=(ans+1)%998244353;
 .
      }
  }
  cout<<ans<<'\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected primary-expression before '.' token
   28 |  .
      |  ^
a.cc:29:7: error: expected unqualified-id before '}' token
   29 |       }
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define MOD 998244353
using Graph=vector<vector<int>>;

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

  ll ans=0;
  vector<vector<ll>> dp(N+1,vector<ll>(S+1,0));
  dp.at(0).at(0)=1;
  for(int i=1;i<=N;i++){
    for(int j=0;j<=S;j++){
      dp.at(i).at(j)=dp.at(i-1).at(j);
    }
    for(int j=0;j+A.at(i-1)<=S;j++){
      if(dp.at(i).at(j)==0){
        continue;
      }
      if(j==0){
        dp.at(i).at(j+A.at(i-1))+=i;
      }else{
        dp.at(i).at(j+A.at(i-1))+=dp.at(i-1).at(j);
      }
      if(j+A.at(i-1)==S){
        ans+=dp.at(i).at(S)*(N-i+1);
        ans%=MOD
      }
    }
  }
  cout<<ans<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:7: error: expected ';' before '}' token
   34 |       }
      |       ^
Language: C++

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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;

const ll MOD = 998244353;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

ll dp[3010][3010][3010];
int main()
{
    int n, s;
    cin >> n >> s;
    vector<ll> a(n);
    rep(i, n)
    {
        cin >> a.at(i);
    }

    ll sum = 0;
    for (int start = 0; start < n; start++) {
        dp[start][start][a.at(start)] = 1;
        if (a.at(i) == s) {
            sum++;
        }
    }

    for (int start = 0; start < n; start++) {
        for (int end = start + 1; end < n; end++) {
            dp[start][end][s] = (((dp[start][end][s] % MOD) + (dp[start + 1][end][s - a.at(start)] % MOD)) % MOD + dp[start + 1][end][s] % MOD) % MOD;
            sum += dp[start][end][s];
            sum = sum % MOD;
        }
    }
    cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:18: error: 'i' was not declared in this scope
   30 |         if (a.at(i) == s) {
      |                  ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int main()
{
 
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll n,s;
  cin>>n>>s;
  ll arr[n],i,ans,sum1=0,sum[n];
  for(i=0;i<n;i++)
  {
      cin>>arr[i];
  }
  for(i=0;i<n;i++)
  {
      sum1=sum1+arr[i];
      sum[i]=sum1;
  }
  for(i=0;i<n;i++)
  {
      for(j=i;j<n;j++)
      {
          if(sum[j]-sum[i]+arr[i]==s)
          ans=(ans+1)%998244353
 .
      }
  }
  cout<<ans<<'\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: 'j' was not declared in this scope
   24 |       for(j=i;j<n;j++)
      |           ^
a.cc:29:7: error: expected unqualified-id before '}' token
   29 |       }
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
//const ll MOD=1000000007;
const ll MOD=998244353;

ll sum[3030],A[3030];
ll dp[3030][3030];

int main(){
  int N,S; cin>>N>>S;
  rep(i,N){
    cin>>A[i];
    sum[i+1]=sum[i]+A[i];
  }
  dp[0][0]=1;
  rep(i,N) rep(j,S+1){
    (dp[i+1][j]+=dp[i][j])%=MOD;
    if(j+A[i]<=S) (dp[i+1][j+A[i]]+=dp[i][j])%=MOD;
  }
  ll ans=0;
  rep(i,N) for(int j=i;j<N;j++){
    (ans+=dp[j+1][S])%=MOD
    ans=(ans-dp[i][S]+MOD)%MOD;
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:27: error: expected ';' before 'ans'
   24 |     (ans+=dp[j+1][S])%=MOD
      |                           ^
      |                           ;
   25 |     ans=(ans-dp[i][S]+MOD)%MOD;
      |     ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n, s;
vector<int> arr;
vector<int> t;

void build(int v, int tl, int tr) {
  if(tl == tr) {
    t[v] = arr[tl];
    return;
  }
  
  int tm = (tl + tr) / 2;
  build(v*2, tl, tm);
  build(v*2 + 1, tm+1, tr);
  t[v] = t[v*2] + t[v*2 + 1];
}

int sum(int v, int tl, int tr, int l, int r) {
  if(l > r)
    return 0;
  if(tl == l && tr == r)
    return t[v];
  
  int tm = (tl + tr) / 2;
  return ((sum(v*2, tl, tm, l, min(r,tm)) + sum(v*2 + 1, tm+1, tr, max(l,tm+1), r));
}

int main() {
  cin >> n >> s;
  
  arr.resize(n);
  t.resize(4*n);
  
  for(auto &x: arr)
    cin >> x;
  
  build(1, 0, n-1);
  
  vector<pair<int,int>> ans;
  for(int i=0; i<n; i++) {
    for(int j=i; j<n; j++) {
      int res = sum(1, 0, n-1, i, j);
      if(res == s)
        ans.emplace_back(i,j);
    }
  }
  
  long long qwe = 0;
  for(int i=n-1; i>=0; i--) {
    int x = ans.size();
    qwe = (qwe + ((x * (x+1)) / 2)) % 998244353;
    
    for(int j=x; j>=0; j--) {
      if(ans.second >= i)
        ans.pop_back();
    }
  }
  
  cout << qwe << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int sum(int, int, int, int, int)':
a.cc:26:84: error: expected ')' before ';' token
   26 |   return ((sum(v*2, tl, tm, l, min(r,tm)) + sum(v*2 + 1, tm+1, tr, max(l,tm+1), r));
      |          ~                                                                         ^
      |                                                                                    )
a.cc: In function 'int main()':
a.cc:55:14: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   55 |       if(ans.second >= i)
      |              ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define MOD 998244353
using Graph=vector<vector<int>>;

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

  ll ans=0;
  vector<vector<ll>> dp(N+1,vector<ll>(S+1,0));
  dp.at(0).at(0)=1;
  for(int i=1;i<=N;i++){
    for(int j=0;j<=S;j++){
      dp.at(i).at(j)=dp.at(i-1).at(j);
    }
    for(int j=0;j+A.at(i-1)<=S;j++){
      if(dp.at(i).at(j)==0){
        continue;
      }
      if(j==0){
        dp.at(i).at(j+A.at(i-1))+=i;
      }else{
        dp.at(i).at(j+A.at(i-1))+=d.at(i-1).at(j);
      }
      if(j+A.at(i-1)==S){
        ans+=dp.at(i).at(S)*(N-i+1);
        ans%=MOD
      }
    }
  }
  cout<<ans<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:35: error: 'd' was not declared in this scope
   29 |         dp.at(i).at(j+A.at(i-1))+=d.at(i-1).at(j);
      |                                   ^
a.cc:34:7: error: expected ';' before '}' token
   34 |       }
      |       ^
Language: C++

#include<cstdio>
#include<algorithm>
#include<map>
using namespace std;
const int maxn=3005;
const int mod=998244353;
int a[maxn],num[maxn];
int main()
{
    int n,s;
    scanf("%d%d",&n,&s);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        memset(num,0,sizeof(num));
        num[0]=1;
        for(int j=i;j<=n;j++)
        {
            for(int pre=s;pre-a[j]>=0;pre--)
                num[pre]=(num[pre]+num[pre-a[j]])%mod;
            ans=(ans+num[s])%mod;
        }
    }
    printf("%d\n",ans);
    return 0;
}


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

#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <complex>
typedef long long int LL;
using namespace std;

// 插入此處

const int MOD = 998244353;

LL a[3005];
LL dp[3005][3005];

int main() {
    int n, s;
    scanf("%d%d", &n, &s);
    LL ans = 0;
    for (int i = 0; i < n; i++) {
        scanf("%lld", &a[i]);
    }
    for (int start = 0; start < n; start++) {
        dp[start][0] = 1;
        for (int i = start; i < n; i++) {
            for (int j = s; j >= a[i]; j--) {
                if (dp[start][j - a[i]] > 0) {
                    dp[start][j] += dp[start][j - a[i]];
                    dp[start][j] %= M;
                }
            }
            ans += dp[start][s];
            ans %= M;
        }
    }
    printf("%lld\n", ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:37: error: 'M' was not declared in this scope
   33 |                     dp[start][j] %= M;
      |                                     ^
a.cc:37:20: error: 'M' was not declared in this scope
   37 |             ans %= M;
      |                    ^
Language: C

#pragma GCC optimize ("O3")
#pramga GCC target ("avx")
char buf[20000];sz;
inline int rd()
{
	int ret=0;
	for(;;)
	{
		char k=buf[sz++];
		if(k<'0')break;
		ret=ret*10+k-'0';
	}
	return ret;
}
int d[3001],d2[3001];
const int mod=998244353;
main()
{
	read(0,buf,20000);
	int N=rd();
	int S=rd();
	int ans=0;
	for(int i=0;i<N;i++)
	{
		++d[S];
		int A=rd();
		for(int j=0;j<=S-A;j++)d2[j]=d[j+A];
		for(int j=0;j<=S-A;j++)
		{
			d[j]+=d2[j];
			d[j]-=mod*(d[j]>=mod);
		}
		ans+=d[0];
		ans-=mod*(ans>=mod);
	}
	printf("%d",ans);
}

Compiler output:
main.c:2:2: error: invalid preprocessing directive #pramga; did you mean #pragma?
    2 | #pramga GCC target ("avx")
      |  ^~~~~~
      |  pragma
main.c:3:17: warning: data definition has no type or storage class
    3 | char buf[20000];sz;
      |                 ^~
main.c:3:17: error: type defaults to 'int' in declaration of 'sz' [-Wimplicit-int]
main.c:17:1: error: return type defaults to 'int' [-Wimplicit-int]
   17 | main()
      | ^~~~
main.c: In function 'main':
main.c:19:9: error: implicit declaration of function 'read'; did you mean 'rd'? [-Wimplicit-function-declaration]
   19 |         read(0,buf,20000);
      |         ^~~~
      |         rd
main.c:36:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   36 |         printf("%d",ans);
      |         ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | #pragma GCC optimize ("O3")
main.c:36:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   36 |         printf("%d",ans);
      |         ^~~~~~
main.c:36:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 7 , mod  =998244353; 
int n ,m; 
long long dp[N]; 
 
int main(){
   // freopen("in.in" , "r" , stdin); 
    cin>>n>>m; 
    dp[0] = 1ll;
    long long ans = 0ll;  
    for(int i = 0 ; i< n ;i++){
        int t ; 
        cin>>t ; 
        for(int j = m ; j>0 ; j--){
            dp[j+t]+=dp[j];
            dp[j+t]%=mod;
        }
        dp[t]+=i+1;
        dp[t]%=mod ;    
        ans+=dp[m];
        ans%=mod
    }
    cout<<ans ; 
    return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: expected ';' before '}' token
   24 |         ans%=mod
      |                 ^
      |                 ;
   25 |     }
      |     ~
Language: C++

/*input
10 10
3 1 4 1 5 9 2 6 5 3
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

#define rep(i,j,n) for(i=j;i<n;i++)
#define repi(i,j,n) for(i=j;i>n;i--)
#define inf 100001
#define M 998244353
#define ll long long
#define ld long double
#define vll vector<long long>
#define vi vector<int>
#define pll pair<long long,long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define vpll vector<pair<long long,long long> >
#define pb push_back
#define pf pop_front
#define F first
#define S second
#define endl '\n'

using namespace std;
using namespace __gnu_pbds; 

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


ll power(ll a,ll m,ll mod){
	ll ans=1;
	while(m){
		if(m%2){
			ans*=a;
			ans%=(mod);
		}
		a=(a*a)%(mod);
		m>>=1;
	}
	return ans;
}


void init(ll* a,ll n,ll val){
	for(ll i=0;i<n;i++)
		a[i]=val;
}

ll dp[3001][3001];

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);	
	ll t=1,i,j;
	ll n,s;
	cin>>n>>s;
	ll a[n];
	rep(i,0,n)cin>>a[i];
	ll ans=0;
	rep(i,0,n+1)rep(j,0,s+1)dp[i][j]=0;
	dp[0][a[0]]=1;
	ans+=((dp[0][s]*n)%M)%M;
	rep(i,1,n){
		ll k=a[i];
		dp[i][k]+=(i+1);
		dp[i][k]%=M;
		for(j=1;j+k<s+1;j++){
			dp[i][j+k]+=dp[i-1][j];
			dp[i][j+k]%=M;
		}
		ans+=((dp[i][s]*(n-i))%M);
		ans%=M:
		rep(j,0,s+1)dp[i][j]=dp[i-1][j];
		//rep(j,0,s+1)cout<<dp[i][j]<<" ";
		//cout<<endl;
	}
	cout<<ans<<endl;
	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:79:23: error: expected ';' before ':' token
   79 |                 ans%=M:
      |                       ^
a.cc:10:35: error: expected ';' before ')' token
   10 | #define rep(i,j,n) for(i=j;i<n;i++)
      |                                   ^
a.cc:80:17: note: in expansion of macro 'rep'
   80 |                 rep(j,0,s+1)dp[i][j]=dp[i-1][j];
      |                 ^~~
Language: C++

解けません、対戦有難うございました。

Compiler output:
a.cc:1:1: error: extended character 、 is not valid in an identifier
    1 | 解けません、対戦有難うございました。
      | ^
a.cc:1:1: error: extended character 。 is not valid in an identifier
a.cc:1:1: error: '\U000089e3\U00003051\U0000307e\U0000305b\U00003093\U00003001\U00005bfe\U00006226\U00006709\U000096e3\U00003046\U00003054\U00003056\U00003044\U0000307e\U00003057\U0000305f\U00003002' does not name a type
    1 | 解けません、対戦有難うございました。
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define X first
#define Y second
#define PB push_back
#define ll long long
#define pii pair<ll,ll>
#define MEM(x,y) memset(x,y,sizeof(x))
#define bug(x) cout<<"debug "#x" is "<<x<<endl;
#define FIO ios::sync_with_stdio(false);
#define ALL(x) x.begin(),x.end()
#define LOG 20
#define lson(x) ((x)<<1)
#define rson(x) ((x)<<1|1)
int a[3010];long long dp[3010];
const int mod=998244353;
int main()
{
	int n,s;
	cin>>n>>s;
	for(int i=1;i<=n;i++) 
		scanf("%d",&a[i]);
    long long ans=0;
	for(int i=1;i<=n;i++)
	{
		for(int j=s-a[i];j>=0;j--)
			dp[j+a[i]]=(dp[j+a[i]]+dp[j])%mod;
		dp[a[i]]+=i;
		ans=(ans+dp[s])%mod;
	}
    printf("%lld\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   19 |         cin>>n>>s;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 998244353
const double EPS = 1e-9;

int DP[3010];

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

	int N, S;
	cin >> N >> S;
	vector<int> A(N);
	rep(i, 0, N)cin >> A[i];

	int ans = 0;
	rep(i, 0, N)
	{
		if (A[i] > S)continue;
		ans += DP[S-A[i]] * (N - i);
		if (A[i] == S)ans += (i + 1)*(N - i);
		ans %= MOD;
		rrep(j, 0, S)
		{
			if (j + A[i] <= S)
			{
				DP[j + A[i]] += DP[j];
				DP[j + A[i]] %= MOD;
			}
		}
		DP[A[i]] += i + 1;
		DP[A[i]] %= MOD;
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc:53:1: error: expected ',' or ';' before 'const'
   53 | const double EPS = 1e-9;
      | ^~~~~