题意:
给你n值,求 ⌊10an⌋.
n<=1e9;
题解:
找规律
一眼看出, 10an=n+a(n-1)
上来交了个n+lg(n-1+lg(n-2+lg(n-3)));wa,,,,,,
右交一发写到9.。。。。还是wa。。。。这我就很纳闷了。
最后老老实实求一下会不会进位ac
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5+5;
const int mod=1e9+7;
#define ll long long
inline int read(){int x=0,f=1;char c=getchar();for(;!isdigit(c);c=getchar())
if(c=='-')f=-1;for(;isdigit(c);c=getchar())x=x*10+c-'0';return x*f;}
int main(){
ll n,ans,q;
while(~scanf("%lld",&n)){
q=0;
if(n<=10){
printf("%lld\n",n);
continue;
}
ll l1=(int)log10(n);
ll s=n+l1-1;
ll l2=(int)log10(s);
ll f=0;
if(l2>l1) f=1;
printf("%lld\n",n+l1+f);
}
return 0;
}