Counting Subsets

AtCoder
IDarc143_f
Time2000ms
Memory256MB
Difficulty
Given a positive integer $N$, find the number, modulo $998244353$, of subsets $S$ of ${1, 2, \ldots, N}$ that satisfy the following condition. * Every positive integer at most $N$ can be represented as the sum of some distinct elements of $S$, and there are at most two such representations. ## Constraints * $1 \leq N \leq 1500$ ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
3
Output #1
2

The subsets ${1,2}$ and ${1,2,3}$ satisfy the condition.
Input #2
5
Output #2
5
Input #3
1000
Output #3
742952024
API Response (JSON)
{
  "problem": {
    "name": "Counting Subsets",
    "description": {
      "content": "Given a positive integer $N$, find the number, modulo $998244353$, of subsets $S$ of ${1, 2, \\ldots, N}$ that satisfy the following condition. *   Every positive integer at most $N$ can be represente",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc143_f"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given a positive integer $N$, find the number, modulo $998244353$, of subsets $S$ of ${1, 2, \\ldots, N}$ that satisfy the following condition.\n\n*   Every positive integer at most $N$ can be represente...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments