Submission #374278

#TimeUsernameProblemLanguageResultExecution timeMemory
374278AraragiEuklid (COCI20_euklid)C++17
0 / 110
1090 ms372 KiB
/* * author: Araragi */ // 3 #include <bits/stdc++.h> using namespace std; #define pb push_back #define F first #define S second //using namespace __gnu_pbds; //typedef tree <int, null_type, less_equal <int> , rb_tree_tag, tree_order_statistics_node_update> ordered_set; typedef long long ll; typedef long double ld; typedef unsigned long long ull; ll R(ll a, ll b) { if (a < b) return R(b, a); else if (a >= b && b > 1) return R(ll(a / b), b); else if (a >= b && b == 1) return a; } int main() { //ifstream cin("vacation.in"); //ofstream cout("vacation.out"); int tt; cin >> tt; while (tt--) { ll x, y; cin >> x >> y; bool fnd = 0; for (ll i = 1; i <= ll(1e3); i++) { if (fnd) break; for (ll j = 1; j <= ll(1e3); j++) if (__gcd(i, j) == x && R(i, j) == y) { cout << i << " " << j << '\n'; fnd = 1; break; } } } }

Compilation message (stderr)

euklid.cpp: In function 'll R(ll, ll)':
euklid.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^
#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...