| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1291907 | lukaye_19 | Arranging Shoes (IOI19_shoes) | C++20 | 12 ms | 1956 KiB |
#include <bits/stdc++.h>
using namespace std;
int count_swaps(vector<int>shoes)
{
int n = shoes.size() / 2;
bool leftrightshoes = true;
for (int i = 0; i < n * 2; i++)
{
int a = shoes[i];
if ((i <= n - 1 && a > 0) || (i > n - 1 && i <= n * 2 - 1 && a < 0)) leftrightshoes = false;
shoes[i] = a;
}
if (n == 1)
{
if (shoes[0] > shoes[1])
{
return 1;
}
else
{
return 0;
}
}
int answer = (n * (n - 1)) / 2;
return answer;
}| # | 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... | ||||
