44492023-03-28 10:42:16uBORKAA sárkány feladványa (50)cpp17Wrong answer 0/503ms3844 KiB
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,b,c,szam,N;
    int hossz = 1;
    int szam2;
    int ae, be;

    int q[3][3] = {0};
    cin>> q[0][0] >> q[0][1] >> q[0][2] >> q[1][0] >> q[1][1] >> q[1][2] >> q[2][0] >> q[2][1] >> q[2][2];
    for(int l = 0; l<=2; l++)
    {
    ae=q[l][0];
    be=q[l][1];
    N = q[l][2];
    //cout<<ae<<" "<<be<<" "<<N<<endl;
    a=ae;
    b=be;

    if(b>a)
    {
       c=a;
       a=b;
       b=c;
    }
    while(a%b!=0)
    {
        c=a-b*(a/b);
        a=b;
        b=c;
    }
    szam=(ae*be)/b;
    szam2=szam;
    while(szam>=10)
    {
        hossz++;
        szam/=10;
    }
    if(hossz>N)
    {
        cout<<-1;
    }
    else
    {
        cout<<szam2;
        for(int i = (N-hossz); i>0; i--)
        {
            cout<<0;
        }
    }
    cout<<endl;
    }
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1872 KiB
2Wrong answer0/03ms2276 KiB
3Wrong answer0/33ms2340 KiB
4Wrong answer0/33ms2496 KiB
5Wrong answer0/33ms2856 KiB
6Wrong answer0/33ms3088 KiB
7Wrong answer0/33ms3140 KiB
8Wrong answer0/33ms3156 KiB
9Wrong answer0/33ms3284 KiB
10Wrong answer0/33ms3292 KiB
11Wrong answer0/33ms3544 KiB
12Wrong answer0/33ms3508 KiB
13Wrong answer0/43ms3508 KiB
14Wrong answer0/43ms3636 KiB
15Wrong answer0/43ms3720 KiB
16Wrong answer0/43ms3720 KiB
17Wrong answer0/43ms3844 KiB