QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100 Hackable ✓

#13644. 复读机

统计

群里有$k$个不同的复读机。为了庆祝平安夜的到来,在接下来的$n$秒内,它们每秒钟都会选出一位优秀的复读机进行复读。非常滑稽的是,一个复读机只有总共复读了$d$的倍数次才会感到快乐。问有多少种不同的安排方式使得所有的复读机都感到快乐。

输入格式

一行三个正整数$n$,$k$,$d$,意义如题目描述所述。

输出格式

一行一个正整数,表示方案数对$19491001$取模的值。

样例一

input

4 2 2

output

8

限制与约定

本题采用子任务方式评测

子任务一 $(5pts)$:$d=1$

子任务二 $(25pts)$:$n\leq 1000,k\leq 100$

子任务三 $(30pts)$: $k\leq 500000,d=2$

子任务四 $(40pts)$: $k\leq 1000,d=3$

对于所有数据,$n\leq 10^9,k\leq 500000,d\leq 3$。

Discussions

About Discussions

The discussion section is only for posting: Editorials, 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. Submitting multiple issues may cause your account to be banned.
  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.