codeforces Educational Codeforces Round 80 (Rated for Div. 2) B - Yet Another Meme Problem(规律)

在这里插入图片描述
题意:找出满足conc(a,b)的a,b关系对数量;
思路:规律题,发现只要b是9,99,999等等的都满足条件

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	int T;
	ll a,b,cnt;
	scanf("%d",&T);
	while(T--)
	{
		cnt=0;
		scanf("%lld %lld",&a,&b);
		ll num=0;
		while(b>=num)
		{
			num=num*10+9;
			cnt++;
		}
		printf("%lld\n",a*(cnt-1));
	}
 } 
发布了39 篇原创文章 · 获赞 0 · 访问量 1083

猜你喜欢

转载自blog.csdn.net/qq_42479630/article/details/104009826