16 Integers

AtCoder
IDabc336_g
Time2000ms
Memory256MB
Difficulty
You are given $16$ non-negative integers $X_{i, j, k, l}$ $(i, j, k, l \in \lbrace 0, 1 \rbrace)$ in ascending order of $(i, j, k, l)$. Let $N = \displaystyle \sum_{i=0}^1 \sum_{j=0}^1 \sum_{k=0}^1 \sum_{l=0}^1 X_{i,j,k,l}$. Find the number, modulo $998244353$, of sequences $(A_1, A_2, ..., A_{N+3})$ of length $N + 3$ consisting of $0$s and $1$s that satisfy the following condition. * For every quadruple of integers $(i, j, k, l)$ $(i, j, k, l \in \lbrace 0, 1 \rbrace)$, there are exactly $X_{i,j,k,l}$ integers $s$ between $1$ and $N$, inclusive, that satisfy: * $A_s = i$, $A_{s + 1} = j$, $A_{s + 2} = k$, and $A_{s + 3} = l$. ## Constraints * $X_{i, j, k, l}$ are all non-negative integers. * $1 \leq \displaystyle \sum_{i=0}^1 \sum_{j=0}^1 \sum_{k=0}^1 \sum_{l=0}^1 X_{i,j,k,l} \leq 10^6$ ## Input The input is given from Standard Input in the following format: $X_{0,0,0,0}$ $X_{0,0,0,1}$ $X_{0,0,1,0}$ $X_{0,0,1,1}$ $X_{0,1,0,0}$ $X_{0,1,0,1}$ $X_{0,1,1,0}$ $X_{0,1,1,1}$ $X_{1,0,0,0}$ $X_{1,0,0,1}$ $X_{1,0,1,0}$ $X_{1,0,1,1}$ $X_{1,1,0,0}$ $X_{1,1,0,1}$ $X_{1,1,1,0}$ $X_{1,1,1,1}$ [samples]
Samples
Input #1
0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0
Output #1
1

This input corresponds to the case where $X_{1, 0, 1, 0}$ and $X_{1, 1, 0, 1}$ are $1$ and all others are $0$.  
In this case, only one sequence satisfies the condition, which is $(1, 1, 0, 1, 0)$.
Input #2
1 1 2 0 1 2 1 1 1 1 1 2 1 0 1 0
Output #2
16
Input #3
21 3 3 0 3 0 0 0 4 0 0 0 0 0 0 0
Output #3
2024
Input #4
62 67 59 58 58 69 57 66 67 50 68 65 59 64 67 61
Output #4
741536606
API Response (JSON)
{
  "problem": {
    "name": "16 Integers",
    "description": {
      "content": "You are given $16$ non-negative integers $X_{i, j, k, l}$ $(i, j, k, l \\in \\lbrace 0, 1 \\rbrace)$ in ascending order of $(i, j, k, l)$.   Let $N = \\displaystyle \\sum_{i=0}^1 \\sum_{j=0}^1 \\sum_{k=0}^1 ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc336_g"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given $16$ non-negative integers $X_{i, j, k, l}$ $(i, j, k, l \\in \\lbrace 0, 1 \\rbrace)$ in ascending order of $(i, j, k, l)$.  \nLet $N = \\displaystyle \\sum_{i=0}^1 \\sum_{j=0}^1 \\sum_{k=0}^1 ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments