| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1293035 | lukaye_19 | Arranging Shoes (IOI19_shoes) | C++20 | 14 ms | 2732 KiB |
#include <bits/stdc++.h>
using namespace std;
long long count_swaps(vector<int>Shoes) {
vector<int>ShoesQueue = Shoes;
int SameSizeAnswer = 0;
int c1 = 0;
int c2 = 0;
int cnt = 0;
for (int i = 0; i < ShoesQueue.size(); i++)
{
int Shoe = ShoesQueue[i];
if (Shoe < 0)
{
cnt += abs(i - c1 * 2);
c1++;
}
else if (Shoe > 0 )
{
cnt += abs(i - c2 * 2 - 1);
c2++;
}
}
SameSizeAnswer = cnt / 2;
return SameSizeAnswer;
}| # | 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... | ||||
