72082024-01-03 14:43:24MagyarKendeSZLGA sárkány feladványa (50)cpp17Wrong answer 32/503ms3720 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--) {
        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/03ms1896 KiB
2Accepted0/03ms2264 KiB
3Accepted3/33ms2256 KiB
4Accepted3/33ms2456 KiB
5Accepted3/33ms2636 KiB
6Accepted3/33ms2844 KiB
7Accepted3/33ms2920 KiB
8Wrong answer0/33ms3048 KiB
9Wrong answer0/33ms3240 KiB
10Accepted3/33ms3256 KiB
11Accepted3/33ms3264 KiB
12Accepted3/33ms3264 KiB
13Wrong answer0/43ms3264 KiB
14Accepted4/43ms3272 KiB
15Accepted4/43ms3496 KiB
16Wrong answer0/43ms3720 KiB
17Wrong answer0/43ms3720 KiB