210672026-01-12 10:54:09badamA sárkány feladványa (50)cpp17Time limit exceeded 0/50296ms5012 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);
    long long y=pow(10,n-1);
    long long z=pow(10,n);
  if(floor(z/x)==floor(y/x))
        {
            cout << -1;
        }
    else
    {
        cout << x;
        int t=x, p=0;
        while(t!=0)
        {
            p++;
            t=t/10;
        }
        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/0277ms4712 KiB
2Time limit exceeded0/0277ms4664 KiB
3Time limit exceeded0/3279ms4660 KiB
4Time limit exceeded0/3277ms4660 KiB
5Time limit exceeded0/3294ms4868 KiB
6Runtime error0/32ms604 KiB
7Time limit exceeded0/3296ms5012 KiB
8Time limit exceeded0/3296ms4916 KiB
9Runtime error0/31ms316 KiB
10Time limit exceeded0/3282ms4420 KiB
11Time limit exceeded0/3282ms4660 KiB
12Time limit exceeded0/3282ms4692 KiB
13Runtime error0/41ms316 KiB
14Runtime error0/42ms316 KiB
15Runtime error0/42ms316 KiB
16Runtime error0/42ms508 KiB
17Runtime error0/42ms316 KiB