# Educational Codeforces Round 80 (Rated for Div. 2)B. Yet Another Meme Problem

powWA代码：

/*by freesteed*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fill(x,c) memset(x,c,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
const int SIZE = 1e6+10;
ll a[SIZE];
int main() {
//ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
ll t,A,B;
cin>>t;
while(t--){
cin>>A>>B;
// 9 99 999 9999 99999...
ll cnt = 1;
while(B>=(ll)pow(10,cnt)-1)cnt++;
cout<<A*(cnt-1)<<endl;

}
return 0;
}



powmod:

/*by freesteed*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fill(x,c) memset(x,c,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=100000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
const int SIZE = 1e6+10;
ll a[SIZE];
int main() {
//ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
ll t,A,B;
cin>>t;
while(t--){
cin>>A>>B;
// 9 99 999 9999 99999...
ll cnt = 1;
while(B>=powmod(10,cnt)-1)cnt++;
cout<<A*(cnt-1)<<endl;
}
return 0;
}


©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客