72102024-01-03 14:47:11MagyarKendeSZLGA sárkány feladványa (50)cpp17Accepted 50/503ms3828 KiB
#include <bits/stdc++.h>

#define speed cin.tie(0); ios::sync_with_stdio(0)
#define cinv(v) for (auto& e : v) cin >> e;
#define all(v) v.begin(), v.end()
#define has(s, e) s.count(e)

using namespace std;
using ll = long long;
using point = array<int, 2>;

ll digc(ll n) {
    ll result = 1;

    while (n / 10 != 0) {
        n /= 10;
        result++;
    }

    return result;
}

int main() {
    speed;

    int cnt = 3;
    while (cnt--) {
        ll A, B, N;
        cin >> A >> B >> N;
        ll mn = lcm(A, B), rem = N - digc(mn);
        if (rem < 0) {
            cout << -1;
        } else {
            cout << mn;
            for (ll i = 0; i < rem; i++) cout << 0;
        }
        cout << '\n';
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1892 KiB
2Accepted0/03ms2264 KiB
3Accepted3/33ms2384 KiB
4Accepted3/33ms2348 KiB
5Accepted3/33ms2552 KiB
6Accepted3/33ms2752 KiB
7Accepted3/33ms2856 KiB
8Accepted3/33ms3056 KiB
9Accepted3/33ms3256 KiB
10Accepted3/33ms3340 KiB
11Accepted3/33ms3344 KiB
12Accepted3/33ms3336 KiB
13Accepted4/43ms3464 KiB
14Accepted4/43ms3552 KiB
15Accepted4/43ms3828 KiB
16Accepted4/43ms3696 KiB
17Accepted4/43ms3804 KiB