# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432094 | LouayFarah | Arranging Shoes (IOI19_shoes) | C++14 | 34 ms | 3244 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 "bits/stdc++.h"
#include "shoes.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long int
ll count_swaps(vector<int> s)
{
int n = (int)s.size()/2;
ll res = 0;
int cnt = 0;
for(int i = 0; i<2*n; i++)
{
if(s[i]>0)
{
if(cnt>=0)
cnt++;
else
{
cnt++;
res+=-cnt;
}
}
else
{
if(cnt>=0)
{
# | 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... |