# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
240838 | RayaBurong25_1 | Arranging Shoes (IOI19_shoes) | C++17 | 5 ms | 768 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 <map>
#include <vector>
#include <algorithm>
#include <set>
int abs(int a)
{
return (a < 0)?-a:a;
}
long long count_swaps(std::vector<int> s) {
int i, sz;
long long cnt = 0;
std::map<int, std::vector<int> > pos;
for (i = 0; i < s.size(); i++)
{
sz = abs(s[i]);
if (pos.find(sz) == pos.end())
pos[sz] = std::vector<int>();
pos[sz].push_back(i);
}
int nxt;
std::vector<int> moved;
int ismoved[100005] = {0};
for (i = 0; i < s.size(); i++)
{
sz = abs(s[i]);
if (ismoved[i])
continue;
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... |