Submission #473848

# Submission time Handle Problem Language Result Execution time Memory
473848 2021-09-16T10:31:10 Z Ahmed_Solyman Euklid (COCI20_euklid) C++14
0 / 110
1 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll R(ll a,ll b){
    if(a<b)return R(b,a);
    if(a>=b && b>1)return R(a/b,b);
    if(a>=b && b==1)return a;
}
int main()
{
    ll t=1;cin>>t;
    while(t--){
        ll a,b;cin>>a>>b;
        cout<<a*__gcd(a,b)<<" "<<a*R(a,b)<<endl;
    }
    return 0;
}

Compilation message

euklid.cpp: In function 'll R(ll, ll)':
euklid.cpp:11:1: warning: control reaches end of non-void function [-Wreturn-type]
   11 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -