| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1347949 | feyza | Arranging Shoes (IOI19_shoes) | C++20 | 11 ms | 1960 KiB |
#include <bits/stdc++.h>
#include "shoes.h"
using namespace std;
typedef long long ll;
ll solve1(vector<int> & s)
{
if(s[0]>0)
return 1;
else
return 0;
}
long long count_swaps(std::vector<int> S)
{
if(S.size()==2)
return solve1(S);
int cnt_left=0;
int sz=S.size(),ans=0;
for(int i=0;i<sz;i++)
{
if(S[i]<0)
{
cnt_left++;
ans+=(abs(2*cnt_left-1-(i+1)));
}
}
return ans;
}
| # | 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... | ||||
