210712026-01-12 10:59:41badamA sárkány feladványa (50)cpp17Time limit exceeded 0/50300ms5076 KiB
#include <iostream>
#include <numeric>
#include <cmath>
#include <algorithm>
using namespace std;
int cigany(long long a, long long b, long long n)
{
    long long x=lcm(a,b);
     int t=x, p=0;
            while(t!=0)
        {
            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;
    cigany(a,b,c);
    cout << endl;
    cigany(d,e,f);
    cout << endl;
    cigany(g,h,j);
    cout << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Time limit exceeded0/0293ms4916 KiB
2Time limit exceeded0/0293ms4916 KiB
3Runtime error0/31ms316 KiB
4Time limit exceeded0/3293ms4916 KiB
5Runtime error0/31ms316 KiB
6Runtime error0/31ms316 KiB
7Runtime error0/31ms564 KiB
8Runtime error0/31ms500 KiB
9Runtime error0/31ms508 KiB
10Time limit exceeded0/3284ms4620 KiB
11Time limit exceeded0/3300ms4916 KiB
12Time limit exceeded0/3284ms4660 KiB
13Runtime error0/41ms316 KiB
14Time limit exceeded0/4282ms4896 KiB
15Runtime error0/41ms316 KiB
16Time limit exceeded0/4279ms4660 KiB
17Time limit exceeded0/4300ms5076 KiB