# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
601789 | Minindu2006 | Arranging Shoes (IOI19_shoes) | C++14 | 1085 ms | 12436 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "shoes.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll count_swaps(vector<int> s)
{
ll n = s.size() / 2;
if (n == 1)
return s[0] > 0;
set<int> st;
int isb4 = 1;
for (int i = 0; i < n; i++)
{
if (s[i] != -s[i + n] || s[i] > 0)
{
isb4 = 0;
break;
}
}
if (isb4)
return n * (n - 1) / 2;
for(int i=0;i<2*n;i++)
st.insert(s[i]);
if (st.size() == 2)
{
vector<int> l;
Compilation message (stderr)
# | 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... |