95762024-02-23 11:39:04zeytonxA sárkány feladványa (50)cpp17Wrong answer 32/503ms4228 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef queue<ll> qll;
typedef priority_queue<ll> pqll;
typedef vector<vll> v2ll;
typedef map<ll,ll> mll;
typedef vector<pll> vpll;
#define fs first
#define sc second
#define pb push_back

const ll MOD = 1e9+7;

void solve()
{
    ll a, b, c;
    cin >> a >> b >> c;
    // Naive approach
    string ans = to_string(a*b);
    if(ans.size() > c)
        cout << -1 << "\n";
    else
    if(ans.size() == c)
        cout << ans << "\n";
    else
    {
        cout << ans;
        for(ll i = 0; i < c-ans.size(); i++)
            cout << "0";
        cout << "\n";
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll t = 3;
    //cin >> t;
    while(t--)
        solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base32/50
1Accepted0/03ms1824 KiB
2Accepted0/03ms2020 KiB
3Accepted3/33ms2228 KiB
4Accepted3/33ms2612 KiB
5Wrong answer0/33ms2648 KiB
6Wrong answer0/33ms2864 KiB
7Wrong answer0/33ms3016 KiB
8Accepted3/33ms3160 KiB
9Accepted3/33ms3652 KiB
10Wrong answer0/33ms3644 KiB
11Wrong answer0/32ms3616 KiB
12Wrong answer0/33ms3740 KiB
13Accepted4/43ms3832 KiB
14Accepted4/43ms4028 KiB
15Accepted4/43ms4108 KiB
16Accepted4/43ms4100 KiB
17Accepted4/43ms4228 KiB