90242024-02-12 11:14:36akososkaA sárkány feladványa (50)cpp17Wrong answer 32/503ms3256 KiB
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    struct felad{
        int egy;
        int mas;
        int jegy;
    }a[4];
    for(int i=1;i<=3;i++){
        cin>>a[i].egy;
        cin>>a[i].mas;
        cin>>a[i].jegy;
    }
    for(int i=1;i<=3;i++){
        long long q=a[i].egy%a[i].mas;int s1=a[i].egy,s2=a[i].mas;
        while(q!=0){
            s1=s2;
            s2=q;
            q=s1%s2;
        }
        q=a[i].egy/s2*a[i].mas;
        int k=0;
        long long q2=q;
        while(q2!=0){
            k++;
            q2=q2/10;
        }
        if(k>a[i].jegy)cout<<-1;
        else{
            cout<<q;
            for(int j=k;j<a[i].jegy;j++)cout<<0;
        }
        cout<<endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base32/50
1Accepted0/03ms1900 KiB
2Accepted0/03ms2052 KiB
3Accepted3/33ms2416 KiB
4Accepted3/33ms2544 KiB
5Accepted3/32ms2764 KiB
6Accepted3/32ms2644 KiB
7Accepted3/33ms2720 KiB
8Wrong answer0/32ms2724 KiB
9Wrong answer0/32ms2888 KiB
10Accepted3/33ms3016 KiB
11Accepted3/33ms3144 KiB
12Accepted3/32ms3136 KiB
13Wrong answer0/43ms3144 KiB
14Accepted4/43ms3140 KiB
15Accepted4/43ms3140 KiB
16Wrong answer0/43ms3256 KiB
17Wrong answer0/43ms3256 KiB