229642026-01-16 09:53:07tepucagnesA sárkány feladványa (50)cpp17Wrong answer 3/50300ms512 KiB
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    long long a;
    int b;
    int o=0;
    int c, d, e, f, g, h, i, j=-1;
    cin >> a >> b >> c;
    cin >> d >> e >> f;
    cin >> g >> h >> i;
    long long p=pow(10,c-1), k=pow(10,f-1), m=pow(10,i-1);
    while (p<pow(10,c) and o<1)
    {
        if (p%a==0 and p%b==0)
        {
            j=p;
            o++;
        }
        p++;
    }
    cout << j << endl;
    j=-1;
    while (k<pow(10,f) and o<1)
    {
        if (k%d==0 and k%e==0)
        {
            j=k;
            o++;
        }
        k++;
    }
    cout << j << endl;
    j=-1;
    while (m<pow(10,i) and o<1)
    {
        if (m%g==0 and m%h==0)
        {
            j=m;
            o++;
        }
        m++;
    }
    cout << j;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Wrong answer0/01ms316 KiB
2Time limit exceeded0/0275ms316 KiB
3Wrong answer0/31ms316 KiB
4Wrong answer0/31ms500 KiB
5Wrong answer0/31ms316 KiB
6Accepted3/32ms508 KiB
7Wrong answer0/31ms316 KiB
8Time limit exceeded0/3298ms316 KiB
9Time limit exceeded0/3300ms316 KiB
10Wrong answer0/368ms316 KiB
11Wrong answer0/319ms508 KiB
12Wrong answer0/31ms316 KiB
13Time limit exceeded0/4300ms500 KiB
14Wrong answer0/42ms512 KiB
15Wrong answer0/44ms316 KiB
16Time limit exceeded0/4300ms316 KiB
17Wrong answer0/43ms316 KiB