90222024-02-12 11:09:46PedriA sárkány feladványa (50)cpp17Wrong answer 22/503ms3576 KiB
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
   ifstream f("be.in");
    for(int d=1;d<=3;d++){
      int x, y, t;
      cin>>x>>y>>t;
      int a=x, b=y, lkkt;
      int m=a%b;
      while(m!=0){
         a=b;
         b=m;
         m=a%b;
      }
      lkkt=x*y/b;
      int r=lkkt;
      int j=0;
      while(r!=0){
         j++;
         r=r/10;
      }
      if(j<=t){
         cout<<lkkt;
         for(int i=j+1;i<=t;i++)cout<<0;
      cout<<endl;
      }else cout<<"-1"<<endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base22/50
1Accepted0/03ms1808 KiB
2Wrong answer0/03ms2060 KiB
3Accepted3/33ms2280 KiB
4Accepted3/33ms2440 KiB
5Accepted3/33ms2656 KiB
6Accepted3/32ms2748 KiB
7Accepted3/33ms2872 KiB
8Wrong answer0/33ms3092 KiB
9Wrong answer0/32ms3180 KiB
10Wrong answer0/33ms3184 KiB
11Wrong answer0/32ms3192 KiB
12Accepted3/33ms3332 KiB
13Wrong answer0/43ms3416 KiB
14Accepted4/43ms3448 KiB
15Wrong answer0/43ms3428 KiB
16Wrong answer0/43ms3544 KiB
17Wrong answer0/43ms3576 KiB