QOJ.ac

QOJ

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

#959. כפולה?

الإحصائيات

בהינתן מספר שלם $n$, סדרה נקראת טובה אם איבריה נמצאים בטווח $[1,n]$, ולכל תת־סדרה לא ריקה שלה (לא בהכרח רציפה), סכום האיברים אינו מתחלק ב־$n$.

חשבו את מספר הסדרות הטובות באורך $n-k$, מודולו $998\,244\,353$.

קלט

השורה היחידה של הקלט מכילה שני מספרים שלמים $n,k$ ($1 \le k \le n/4 < n < 998\,244\,353$).

פלט

הדפיסו מספר אחד — התשובה לבעיה.

דוגמאות

קלט 1

4 1

פלט 1

2

קלט 2

9 2

פלט 2

48

קלט 3

222222222 222222

פלט 3

851798824

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#319EditorialOpen题解jianglyView

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.