72092024-01-03 14:45:09MagyarKendeSZLGA sárkány feladványa (50)cpp17Wrong answer 47/503ms3328 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>;

int digc(int n) {
    int 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 (int i = 0; i < rem; i++) cout << 0;
        }
        cout << '\n';
    }
}
SubtaskSumTestVerdictTimeMemory
base47/50
1Accepted0/03ms1888 KiB
2Accepted0/03ms2120 KiB
3Accepted3/33ms2336 KiB
4Accepted3/33ms2508 KiB
5Accepted3/33ms2588 KiB
6Accepted3/33ms2616 KiB
7Accepted3/33ms2820 KiB
8Accepted3/33ms3032 KiB
9Wrong answer0/33ms3108 KiB
10Accepted3/33ms3116 KiB
11Accepted3/33ms3216 KiB
12Accepted3/33ms3216 KiB
13Accepted4/43ms3116 KiB
14Accepted4/43ms3116 KiB
15Accepted4/43ms3248 KiB
16Accepted4/43ms3324 KiB
17Accepted4/43ms3328 KiB