210702026-01-12 10:59:24bombinigusiniA sárkány feladványa (50)cpp17Wrong answer 36/501ms536 KiB
#include <iostream>
#include <numeric>
#include <cmath>
using namespace std;

void rejtveny (long long a, long long b, long long n)
{
    long long lkkt=lcm(a, b);
        int szj=0, s=lkkt;
        while(s>0)
        {
            s=s/10;
            szj++;
        }
        if(szj>n)cout<<-1<<endl;
        else{
        cout<<lkkt;
        for(int i=0; i<n-szj; i++)
        {
            cout<<0;
        }
        cout<<endl;
    }
    }
int main()
{
    long long a1, b1, n1, a2, b2, n2, a3, b3, n3;
    cin>>a1>>b1>>n1;
    cin>>a2>>b2>>n2;
    cin>>a3>>b3>>n3;
    rejtveny(a1, b1, n1);
    rejtveny(a2, b2, n2);
    rejtveny(a3, b3, n3);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base36/50
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms324 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms316 KiB
12Accepted3/31ms316 KiB
13Wrong answer0/41ms316 KiB
14Accepted4/41ms536 KiB
15Accepted4/41ms388 KiB
16Accepted4/41ms316 KiB
17Wrong answer0/41ms316 KiB