| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1321328 | jahinahnaf | Arranging Shoes (IOI19_shoes) | C++20 | 1 ms | 332 KiB |
#include "shoes.h"
#include <math.h>
long long count_swaps(std::vector<int> s)
{
int n = s.size();
if (n == 2)
{
if (s[0] == -1)
return 0;
}
else
{
long long swaps = 0;
int k = 0;
for (int i = 0; i < n; i++)
{
if (s[i] == -1)
{
int target = 2 * k;
swaps += abs(i - target);
k++;
}
}
return swaps;
}
return 1;
}
| # | 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... | ||||
