243032026-02-08 16:22:47KoszorusBlankaA sárkány feladványa (50)cpp17Wrong answer 32/501ms508 KiB
#include <bits/stdc++.h>

using namespace std;

long long lkkt(int A, int B) {
    int nagyobb = max(A, B);
    int kisebb = min(A, B);

    int x = nagyobb;
    while (x % kisebb != 0)
        x += nagyobb;

    return x;
}

int main()
{
    queue <string> valaszok;
    for (int i = 1; i <= 3; i++) {

        int A, B, N;
        cin >> A >> B >> N;

        long long x = lkkt(A, B);
        string szam = to_string(lkkt(A, B));

        if (szam.length() > N) valaszok.push("-1");
        else {
            int x = szam.length();
            for (int i = 1; i <= (N-x); i++)
                szam += '0';
            valaszok.push(szam);
        }

    }

    for (int i = 0; i < 3; i++) {
        cout << valaszok.front() << endl;
        valaszok.pop();
    }

    return 0;
}

SubtaskSumTestVerdictTimeMemory
base32/50
1Accepted0/01ms316 KiB
2Accepted0/01ms500 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 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/31ms508 KiB
13Wrong answer0/41ms332 KiB
14Accepted4/41ms316 KiB
15Accepted4/41ms508 KiB
16Wrong answer0/41ms332 KiB
17Wrong answer0/41ms500 KiB