Submission #473907

# Submission time Handle Problem Language Result Execution time Memory
473907 2021-09-16T11:47:41 Z Ahmed57 Euklid (COCI20_euklid) C++14
0 / 110
119 ms 292 KB
#include <bits/stdc++.h>
using namespace std;
long long r(long long a,long long b){
    if(a<b)return r(b,a);
    else if(a>=b&&b>1)return r(abs(a/b),b);
    else if(a>=b&&b==1)return a;
}
int main(){
    //ios_base::sync_with_stdio(false);cin.tie(NULL);
    int t;cin>>t;
    z:while(t--){
        long long a,b;
        cin>>a>>b;
        for(int i = 1;i<300;i++){
            for(int j = 1;j<300;j++){
                if(__gcd(i,j)==a&&r(i,j)==b){
                    cout<<i<<" "<<j<<"\n";
                    goto z;
                }
            }
        }
    }
    return 0;
}

Compilation message

euklid.cpp: In function 'long long int r(long long int, long long int)':
euklid.cpp:7:1: warning: control reaches end of non-void function [-Wreturn-type]
    7 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 6 ms 204 KB Output is correct
2 Incorrect 119 ms 204 KB Unexpected end of file - int64 expected
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 7 ms 292 KB Output is correct
2 Correct 45 ms 204 KB Output is correct
3 Incorrect 118 ms 204 KB Unexpected end of file - int64 expected
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 105 ms 204 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 204 KB Output is correct
2 Incorrect 119 ms 204 KB Unexpected end of file - int64 expected
3 Halted 0 ms 0 KB -