Submission #1204651

#TimeUsernameProblemLanguageResultExecution timeMemory
1204651tapilyocaArranging Shoes (IOI19_shoes)C++20
0 / 100
0 ms328 KiB
#include "shoes.h" #include<bits/stdc++.h> using namespace std; template<typename T> using vec = vector<T>; using ll = long long; using vll = vec<ll>; using pll = pair<ll,ll>; #define pb push_back long long count_swaps(std::vector<int> s) { ll n = s.size()>>1; ll out = 0; vll oop1, oop2; for(int i = 0; i < n; i++) { if(s[i] < 0 and i%2) { oop1.pb(i); } else if(s[i] > 0 and not i%2) { oop2.pb(i); } } assert(oop1.size() == oop2.size()); for(int i = 0; i < oop1.size(); i++) { out += abs(oop1[i] - oop2[i]); } return out; }
#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...