1 条题解

  • 0
    @ 2026-3-11 20:40:19
    #include <bits/stdc++.h>
    using namespace std;
    #define int unsigned long long
    const int P=998244353;
    int qpow(int a,int b)
    {
        int res=1;a=a%P;
        for(;b;b>>=1,a=a*a%P)if(b&1)res=res*a%P;
        return res;
    }
    signed main()
    {
    	int n;scanf("%llu",&n);
    	int w=1;while(w<=n)w*=10;
    	printf("%llu\n",n%P*(qpow(w,n)-1)%P*qpow(w-1,P-2)%P);
    	return 0;
    }
    
    • 1

    信息

    ID
    1629
    时间
    2000ms
    内存
    1024MiB
    难度
    9
    标签
    递交数
    33
    已通过
    4
    上传者