# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
278376 | ctziapo | Arranging Shoes (IOI19_shoes) | C++14 | 1 ms | 288 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"
long long count_swaps(std::vector<int> s) {
int ans=0;
/// n^2
int v[s.size()]={};
for(int i=0;i<s.size();i++){
if(v[i]==1)
continue;
int cou=0;
if(s[i]>0)
cou=1;
int f=-s[i];
for(int j=i+1;j<s.size();j++){
if(s[j]==f){
v[j]=1;
v[i]=1;
// cout<<cou<<" "<<i<<" "<<j<<endl;
break;
}
if(v[j]==0){
cou++;
}
}
ans+=cou;
}
return ans;
}
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... |