# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
759827 | ivaziva | Arranging Shoes (IOI19_shoes) | C++14 | 20 ms | 4692 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>
using namespace std;
#define MAXN 200010
long long n;
long long niz[MAXN];
long long count_swaps(vector<int> s)
{
n=s.size()/2;
for (long long i=0;i<s.size();i++) niz[i+1]=s[i];
if (n==1)
{
///test1
if (niz[1]<niz[2]) return 0;
else return 1;
}
long long br=0;
for (long long i=1;i<=n;i++)
{
if (abs(niz[i])==abs(niz[i+n])) br++;
}
if (br==n)
{
///test4
return ((n-1)*n)/2;
}
}
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... |