Submission #1321328

#TimeUsernameProblemLanguageResultExecution timeMemory
1321328jahinahnafArranging Shoes (IOI19_shoes)C++20
10 / 100
1 ms332 KiB
#include "shoes.h" #include <math.h> long long count_swaps(std::vector<int> s) { int n = s.size(); if (n == 2) { if (s[0] == -1) return 0; } else { long long swaps = 0; int k = 0; for (int i = 0; i < n; i++) { if (s[i] == -1) { int target = 2 * k; swaps += abs(i - target); k++; } } return swaps; } return 1; }
#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...