71502023-12-31 17:23:19MagyarKendeSZLGA sárkány feladványa (50)cpp17Wrong answer 32/503ms3476 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 = 0;
    while (0 < n) {
        n /= 10;
        result++;
    }
    return result;
}

int main() {
    speed;

    int cnt = 3;
    while (cnt--) {
        int A, B, N;
        cin >> A >> B >> N;
        int 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
base32/50
1Accepted0/03ms1892 KiB
2Accepted0/03ms2232 KiB
3Accepted3/33ms2352 KiB
4Accepted3/33ms2348 KiB
5Accepted3/33ms2540 KiB
6Accepted3/33ms2636 KiB
7Accepted3/33ms2636 KiB
8Wrong answer0/33ms2624 KiB
9Wrong answer0/33ms2904 KiB
10Accepted3/33ms2976 KiB
11Accepted3/33ms3180 KiB
12Accepted3/33ms3200 KiB
13Wrong answer0/43ms3320 KiB
14Accepted4/43ms3408 KiB
15Accepted4/43ms3476 KiB
16Wrong answer0/43ms3468 KiB
17Wrong answer0/43ms3472 KiB