| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 374279 | Araragi | Euklid (COCI20_euklid) | C++17 | 11 ms | 364 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
* 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(1e2); i++)
{
if (fnd)
break;
for (ll j = 1; j <= ll(1e2); j++)
if (__gcd(i, j) == x && R(i, j) == y)
{
cout << i << " " << j << '\n';
fnd = 1;
break;
}
}
}
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
