| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1351589 | nerrrmin | Gingerbread (BOI25_gcd) | C++20 | 0 ms | 344 KiB |
#include<bits/stdc++.h>
#define endl '\n'
#define pb push_back
using namespace std;
const int maxn = 15;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
int n, a[maxn];
int main()
{
speed();
cin >> n;
for (int i = 1; i <= n; ++ i)
cin >> a[i];
for (int ans = 0; ans <= 10; ++ ans)
{
int x = a[1], y = a[2];
for (int f = 0; f <= ans; ++ f)
{
x = a[1] + f;
y = a[2] + (ans - f);
if(__gcd(x, y) == 1)
{
cout << ans << endl;
return 0;
}
}
}
return 0;
}
| # | 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... | ||||
