HBC214892Tabris减肥记,枚举TheJourneyofGeorAutumn题解

原来我爱你 算法基础篇 52 0
全网最全C++题库,助您快速提升编程技能!题库丰富多样,涵盖各个领域,让您在练习中不断成长!
Once upon a time, there was a witch named Geor Autumn, who set off on a journey across the world. Along the way, she would meet all kinds of people, from a country full of ICPC competitors to a horse in love with dota---but with each meeting, Geor would become a small part of their story, and her own world would get a little bit bigger. Geor just arrived at the state of Shu where people love poems. A poem is a permutation (a1,…,an) is a permutation of [n]{[n]}[n] means that each ai{a_i}ai is an integer in [1,n]{[1,n]}[1,n] and that a1,…,an are distinct.) One poem is good if for all integer i{i}i satisfying i>k{i> k}i>k and i≤n{ile n}i≤n, ai>min(aik,…,ai1) denotes the minimum value among aik,…,ai1. Help Geor calculate how many good poems there are, given n{n}n and k{k}k. To avoid huge numbers, output the answer modulo 998244353{998244353}998244353.

Once upon a time, there was a witch named Geor Autumn, who set off on a journey across the world. Along the way, she would meet all kinds of people, from a country full of ICPC competitors to a horse in love with dota---but with each meeting, Geor would become a small part of their story, and her own world would get a little bit bigger. Geor just arrived at the state of Shu where people love poems. A poem is a permutation (a1,…,an){(a_1,ldots, a_n)}(a1​,…,an​) of [n]{[n]}[n]. ((a1,…,an)(a_1,ldots, a_n)(a1​,…,an​) is a permutation of [n]{[n]}[n] means that each ai{a_i}ai​ is an integer in [1,n]{[1,n]}[1,n] and that a1,…,an{a_1,ldots, a_n}a1​,…,an​ are distinct.) One poem is good if for all integer i{i}i satisfying i>k{i> k}i>k and i≤n{ile n}i≤n, ai>min⁡(ai−k,…,ai−1){a_i>min(a_{i-k}, ldots, a_{i-1})}ai​>min(ai−k​,…,ai−1​). Here min⁡(ai−k,…,ai−1){min(a_{i-k}, ldots, a_{i-1})}min(ai−k​,…,ai−1​) denotes the minimum value among ai−k,…,ai−1{a_{i-k}, ldots, a_{i-1}}ai−k​,…,ai−1​. Help Geor calculate how many good poems there are, given n{n}n and k{k}k. To avoid huge numbers, output the answer modulo 998244353{998244353}998244353.

HBC214892Tabris减肥记,枚举TheJourneyofGeorAutumn题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC214892Tabris减肥记 枚举TheJourneyofGeorAutumn题解