首页 > 其他 > 详细

Educational Codeforces Round 80 (Rated for Div. 2)(BYet Another Meme Problem)

时间:2020-01-15 09:41:39      阅读:82      评论:0      收藏:0      [点我收藏+]

(B)Yet Another Meme Problem

 

题目

 

技术分享图片

 

 

思路:找b中9,99,999,999.。。。比b小的这些个数,然后相乘就行。。。

#include<bits/stdc++.h>
using namespace std;
int main()
{
    //freopen("text","r",stdin);
    int T;
    scanf("%d",&T);
    while(T--)
    {
        long long a,b;
        cin>>a>>b;
        if(b<9)
            printf("0\n");
        else{
            if(b<99)
                cout<<a<<endl;
            else if(b<999)
                cout<<a*2<<endl;
            else if(b<9999)
                cout<<a*3<<endl;
            else if(b<99999)
                cout<<a*4<<endl;
            else if(b<999999)
                cout<<a*5<<endl;
            else if(b<9999999)
                cout<<a*6<<endl;
            else if(b<99999999)
                cout<<a*7<<endl;
            else if(b<999999999)
                cout<<a*8<<endl;
            else
                cout<<a*9<<endl;
        }
 
    }
    return 0;
}

Educational Codeforces Round 80 (Rated for Div. 2)(BYet Another Meme Problem)

原文:https://www.cnblogs.com/Vampire6/p/12194763.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!