468C Hack it!

传送门

题目大意

分析

here

对于最后求p的过程我想再说一下

那个45就是最前一位分别是0~9,所以总贡献就是45乘上每一种数开头对应多少种情况

而后面的10则是他前面可以填多少不同的数对他做的贡献

代码

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int inf = 1e18;
signed main(){
    int a,p,l,r;
    scanf("%lld",&a);
    l=a-inf%a*9%a*9%a;
    r=l+inf-1;
    cout<<l<<' '<<r<<endl;
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/yzxverygood/p/10462646.html