15792022-11-28 07:32:58DragonoidOmegaA sárkány feladványa (50)cpp11Accepted 50/503ms3872 KiB
#include <iostream>

using namespace std;
long long a,b,c,n,p,db,i,k,r;
int main()
{
    for(k=1;k<=3;++k)
    {
        cin>>a>>b>>n;
        p=a*b;
        r=a%b;
        while(r>0)
        {
            a=b;
            b=r;
            r=a%b;
        }

       // cout<<b<<"  ";
        b=p/b;
        c=b;

        db=0;

        while(c>0)
        {
            ++db;
            c=c/10;
        }

        if(db<=n)
        {
            cout<<b;
            for(i=db;i<n;++i)
                cout<<0;

        }
        else cout<<-1;

        cout<<"\n";
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1772 KiB
2Accepted0/02ms1996 KiB
3Accepted3/32ms2196 KiB
4Accepted3/32ms2448 KiB
5Accepted3/32ms2652 KiB
6Accepted3/32ms2856 KiB
7Accepted3/32ms3064 KiB
8Accepted3/32ms3132 KiB
9Accepted3/32ms3212 KiB
10Accepted3/32ms3208 KiB
11Accepted3/32ms3208 KiB
12Accepted3/32ms3340 KiB
13Accepted4/42ms3460 KiB
14Accepted4/42ms3712 KiB
15Accepted4/42ms3788 KiB
16Accepted4/42ms3856 KiB
17Accepted4/42ms3872 KiB