Submission #473902

#TimeUsernameProblemLanguageResultExecution timeMemory
473902Ahmed57Euklid (COCI20_euklid)C++14
0 / 110
1089 ms288 KiB
#include <bits/stdc++.h> using namespace std; long long r(int a,int 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--){ int a,b; cin>>a>>b; for(int i = 1;i<1000;i++){ for(int j = 1;j<1000;j++){ if(__gcd(i,j)==a&&r(i,j)==b){ cout<<i<<" "<<j<<"\n"; goto z; } } } } return 0; }

Compilation message (stderr)

euklid.cpp: In function 'long long int r(int, int)':
euklid.cpp:7:1: warning: control reaches end of non-void function [-Wreturn-type]
    7 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...