QOJ.ac

QOJ

حد الوقت: 4 s حد الذاكرة: 256 MB مجموع النقاط: 100

#959. 倍数?

الإحصائيات

整数 $n$ が与えられたとき、その要素が $[1, n]$ の範囲にあり、かつ空でないすべての部分列(連続である必要はない)の和が $n$ で割り切れないような数列を「良い数列」と呼ぶ。

長さ $n - k$ の良い数列の個数を $998\,244\,353$ で割った余りを求めよ。

入力

入力は1行のみで、2つの整数 $n$ と $k$ が与えられる ($1 \le k \le n/4 < n < 998\,244\,353$)。

出力

問題の答えを1つの数値として出力せよ。

入出力例

入力 1

4 1

出力 1

2

入力 2

9 2

出力 2

48

入力 3

222222222 222222

出力 3

851798824

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#319EditorialOpen题解jiangly2025-12-14 07:04:22View

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.