zoukankan      html  css  js  c++  java
  • Educational Codeforces Round 84 (Rated for Div. 2)E(组合数学)

     1 #define HAVE_STRUCT_TIMESPEC
     2 #include<bits/stdc++.h>
     3 using namespace std;
     4 const int mod = 998244353;
     5 long long p[200007];
     6 int main(){
     7     ios::sync_with_stdio(false);
     8     cin.tie(NULL);
     9     cout.tie(NULL);
    10     int n;
    11     cin>>n;
    12     p[0]=1;
    13     for(int i=1;i<=n;++i)
    14         p[i]=p[i-1]*10%mod;
    15     for(int i=1;i<n;++i){
    16         long long ans=2*10*9*p[n-i-1]%mod;//连续i个数字出现在数字串的两端,以一个不同的数字分隔开,剩下随便选
    17         if(i<=n-2)//可以出现在数字串的中间
    18             ans=(ans+10*(n-i-1)*9*9*p[n-i-2])%mod;//n-i+1种位置,每种位置10种数字,两端以不同的数字分隔开,各有九种,剩下的数字有10^(n-i-2)种情况随便选
    19         cout<<ans<<" ";
    20     }
    21     cout<<10;//n个数字全部相同
    22     return 0;
    23 }
  • 相关阅读:
    括号序列
    单向TSP
    Black Box
    震惊!!!某初中生竟30min一蓝两紫一黑!!!
    荷马史诗
    SUFEQPRE
    UVA劲歌金曲
    UVA城市里的间谍
    饼图----插件
    折线图-----插件
  • 原文地址:https://www.cnblogs.com/ldudxy/p/12594641.html
Copyright © 2011-2022 走看看