210752026-01-12 11:05:13badamA sárkány feladványa (50)cpp17Time limit exceeded 0/50300ms4932 KiB
#include <iostream>
#include <numeric>
#include <cmath>
#include <algorithm>
using namespace std;
int cica(long long a, long long b, long long n)
{
    long long x=lcm(a,b);
    long long t=x, p=0;
    while(t)
    {
        p++;
        t=t/10;
    }
    if(p>=n)
    {
        cout << -1;
    }
    else
    {
        cout << x;
        for(int i=0; i<n-p; i++) cout << 0;
    }
}
int main()
{
    long long a,b,c;
    cin >> a >> b >> c;
    long long d, e,f;
    long long g, h, j;
    cin >> d >> e >> f;
    cin >> g >> h >> j;
    cica(a,b,c);
    cout << endl;
    cica(d,e,f);
    cout << endl;
    cica(g,h,j);
    cout << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Time limit exceeded0/0280ms4684 KiB
2Time limit exceeded0/0279ms4672 KiB
3Runtime error0/31ms508 KiB
4Time limit exceeded0/3280ms4660 KiB
5Runtime error0/31ms316 KiB
6Runtime error0/32ms316 KiB
7Runtime error0/32ms316 KiB
8Runtime error0/32ms316 KiB
9Runtime error0/31ms316 KiB
10Time limit exceeded0/3277ms4628 KiB
11Time limit exceeded0/3300ms4916 KiB
12Time limit exceeded0/3284ms4664 KiB
13Runtime error0/41ms316 KiB
14Time limit exceeded0/4280ms4588 KiB
15Runtime error0/41ms316 KiB
16Time limit exceeded0/4300ms4916 KiB
17Time limit exceeded0/4289ms4932 KiB