# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1274974 | rafsanamin2020 | Arranging Shoes (IOI19_shoes) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "shoes.h"
long long count_swaps(std::vector<int> s)
{
int N = s.size(), p = 0, n = 0;
for (int i = 0; i < N; i += 2)
{
if (s[i] > 0)
{
p++;
}
else if (s[i + 1] < 0)
{
n++;
}
}
return max(p, n);
}