Submission #436575

#TimeUsernameProblemLanguageResultExecution timeMemory
436575rGamerArranging Shoes (IOI19_shoes)C++17
50 / 100
1094 ms1868 KiB
#include <bits/stdc++.h> #define ll long long #define vi vector<int> using namespace std; ll count_swaps(vi s) { int n = s.size(), ans = 0; for(int i = 0; i < n; i += 2) { int j = i + 1; while(s[j] != - s[i]) j++; while(j != i + 1) { ans++; swap(s[j], s[j - 1]); j--; } if(s[i] > 0) { swap(s[i], s[i + 1]); ans++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...