Language: C++

import strutils, sequtils, math
let get = iterator: string {.closure.} =
  for s in stdin.readAll.split: yield s
proc read: int {.inline.} = get().parseInt
template rep(a,b): seq = newSeqWith(b,a)

const Mod = 998244353
const LowModularZero: int = int.low div Mod * Mod
type Fin = distinct int
converter toFin(a: int): Fin = 
  if a >= 0: Fin(a mod Mod)
  else: Fin((a - LowModularZero) mod Mod)
converter toInt(a: Fin): int = a.int
proc `==`(a, b: Fin): bool {.borrow.}
proc `$`(a: Fin): string {.borrow.}
proc `-`(a: Fin): Fin = - a.int
proc `+`(a, b: Fin): Fin {.inline.} = a.int + b.int
proc `-`(a, b: Fin): Fin {.inline.} = a.int - b.int
proc `*`(a, b: Fin): Fin {.inline.} = a.int * b.int
proc euc(a, b: int): tuple[x, y, g: int] =
  if b == 0: return (x: 1, y: 0, g: a)
  let (x, y, g) = euc(b, a mod b)
  (x: y, y: x - a div b * y, g: g)
proc `/`(a, b: Fin): Fin = a.int * euc(b, Mod).x
template implFinAssign(calc, assign) =
  proc assign(a: var Fin; b: Fin) {.inline.} = a = calc(a,b)
implFinAssign(`+`, `+=`)
implFinAssign(`-`, `-=`)
implFinAssign(`*`, `*=`)
implFinAssign(`/`, `/=`)

let n, s = read()
var dp = 0.Fin.repeat 3001
var ans = 0.Fin
for _ in 1..n:
  let a = read()
  for i in countdown(s, a): dp[i] += dp[i-a]
  dp[0] += 1; dp[a] += 1; ans += dp[s]
echo ans

Compiler output:
a.cc:14:6: error: stray '`' in program
   14 | proc `==`(a, b: Fin): bool {.borrow.}
      |      ^
a.cc:14:9: error: stray '`' in program
   14 | proc `==`(a, b: Fin): bool {.borrow.}
      |         ^
a.cc:15:6: error: stray '`' in program
   15 | proc `$`(a: Fin): string {.borrow.}
      |      ^
a.cc:15:8: error: stray '`' in program
   15 | proc `$`(a: Fin): string {.borrow.}
      |        ^
a.cc:16:6: error: stray '`' in program
   16 | proc `-`(a: Fin): Fin = - a.int
      |      ^
a.cc:16:8: error: stray '`' in program
   16 | proc `-`(a: Fin): Fin = - a.int
      |        ^
a.cc:17:6: error: stray '`' in program
   17 | proc `+`(a, b: Fin): Fin {.inline.} = a.int + b.int
      |      ^
a.cc:17:8: error: stray '`' in program
   17 | proc `+`(a, b: Fin): Fin {.inline.} = a.int + b.int
      |        ^
a.cc:18:6: error: stray '`' in program
   18 | proc `-`(a, b: Fin): Fin {.inline.} = a.int - b.int
      |      ^
a.cc:18:8: error: stray '`' in program
   18 | proc `-`(a, b: Fin): Fin {.inline.} = a.int - b.int
      |        ^
a.cc:19:6: error: stray '`' in program
   19 | proc `*`(a, b: Fin): Fin {.inline.} = a.int * b.int
      |      ^
a.cc:19:8: error: stray '`' in program
   19 | proc `*`(a, b: Fin): Fin {.inline.} = a.int * b.int
      |        ^
a.cc:24:6: error: stray '`' in program
   24 | proc `/`(a, b: Fin): Fin = a.int * euc(b, Mod).x
      |      ^
a.cc:24:8: error: stray '`' in program
   24 | proc `/`(a, b: Fin): Fin = a.int * euc(b, Mod).x
      |        ^
a.cc:27:15: error: stray '`' in program
   27 | implFinAssign(`+`, `+=`)
      |               ^
a.cc:27:17: error: stray '`' in program
   27 | implFinAssign(`+`, `+=`)
      |                 ^
a.cc:27:20: error: stray '`' in program
   27 | implFinAssign(`+`, `+=`)
      |                    ^
a.cc:27:23: error: stray '`' in program
   27 | implFinAssign(`+`, `+=`)
      |                       ^
a.cc:28:15: error: stray '`' in program
   28 | implFinAssign(`-`, `-=`)
      |               ^
a.cc:28:17: error: stray '`' in program
   28 | implFinAssign(`-`, `-=`)
      |                 ^
a.cc:28:20: error: stray '`' in program
   28 | implFinAssign(`-`, `-=`)
      |                    ^
a.cc:28:23: error: stray '`' in program
   28 | implFinAssign(`-`, `-=`)
      |                       ^
a.cc:29:15: error: stray '`' in program
   29 | implFinAssign(`*`, `*=`)
      |               ^
a.cc:29:17: error: stray '`' in program
   29 | implFinAssign(`*`, `*=`)
      |                 ^
a.cc:29:20: error: stray '`' in program
   29 | implFinAssign(`*`, `*=`)
      |                    ^
a.cc:29:23: error: stray '`' in program
   29 | implFinAssign(`*`, `*=`)
      |                       ^
a.cc:30:15: error: stray '`' in program
   30 | implFinAssign(`/`, `/=`)
      |               ^
a.cc:30:17: error: stray '`' in program
   30 | implFinAssign(`/`, `/=`)
      |                 ^
a.cc:30:20: error: stray '`' in program
   30 | implFinAssign(`/`, `/=`)
      |                    ^
a.cc:30:23: error: stray '`' in program
   30 | implFinAssign(`/`, `/=`)
      |                       ^
a.cc:35:10: error: too many decimal points in number
   35 | for _ in 1..n:
      |          ^~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import strutils, sequtils, math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:40: error: expected unqualified-id before '=' token
    2 | let get = iterator: string {.closure.} =
      |                                        ^
a.cc:4:27: error: expected unqualified-id before '=' token
    4 | proc read: int {.inline.} = get().parseInt
      |                           ^
a.cc:15:1: error: 'proc' does not name a type
   15 | proc `$`(a: Fin): string {.borrow.}
      | ^~~~
a.cc:16:1: error: 'proc' does not name a type
   16 | proc `-`(a: Fin): Fin = - a.int
      | ^~~~
a.cc:17:37: error: expected unqualified-id before '=' token
   17 | proc `+`(a, b: Fin): Fin {.inline.} = a.int + b.int
      |                                     ^
a.cc:18:37: error: expected unqualified-id before '=' token
   18 | proc `-`(a, b: Fin): Fin {.inline.} = a.int - b.int
      |                                     ^
a.cc:19:37: error: expected unqualified-id before '=' token
   19 | proc `*`(a, b: Fin): Fin {.inline.} = a.int * b.int
      |                                     ^
a.cc:26:28: error: found ':' in nested-name-specifier, expected '::'
   26 |   proc assign(a: var Fin; b: Fin) {.inline.} = a = calc(a,b)
      |                            ^
      |                            ::
a.cc:26:27: error: 'b' does not name a type
   26 |   proc assign(a: var Fin; b: Fin) {.inline.} = a = calc(a,b)
      |                           ^
a.cc:26:46: error: expected unqualified-id before '=' token
   26 |   proc assign(a: var Fin; b: Fin) {.inline.} = a = calc(a,b)
      |                                              ^
a.cc:38:15: error: 'dp' does not name a type
   38 |   dp[0] += 1; dp[a] += 1; ans += dp[s]
      |               ^~
a.cc:38:27: error: 'ans' does not name a type
   38 |   dp[0] += 1; dp[a] += 1; ans += dp[s]
      |                           ^~~