Submission #1251274

#TimeUsernameProblemLanguageResultExecution timeMemory
1251274mohamedboukerche55Arranging Shoes (IOI19_shoes)C++20
Compilation error
0 ms0 KiB
#include "shoes.h" using namespace std; long long count_swaps(std::vector<int> s) { int n = s.size() / 2; long long swaps = 0; long long l = 0; long long r = 0; for(int i = 0 ; i < n * (1 << 1) ; i++) { if(S[i] < 0) { l += abs(i - r); p += 2; } } swaps = l; return swaps; }

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:12:20: error: 'S' was not declared in this scope
   12 |                 if(S[i] < 0)
      |                    ^
shoes.cpp:15:25: error: 'p' was not declared in this scope
   15 |                         p += 2;
      |                         ^