2020 HDU多校联盟第一场
1004:Distinct Sub-palindromes
思路:我们通过观察可以得到当时 ,所有字符串的所有子回文串的个数都是n
当 时,每中情况都有如下所示,最小有三个子回文串“abcabc......”
code:
#include<iostream>
#include<cstdio>
using namespace std;
const int mod=998244353;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
if(n<=3){
int ans=1;
while(n--){
ans*=26%mod;
}
cout<<ans<<endl;
}
else cout<<26*25*24<<endl;
}
return 0;
}