Submission #1242576

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

Compilation message (stderr)

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:8:9: error: 'll' was not declared in this scope
    8 |         ll n = s.size()/2;
      |         ^~
shoes.cpp:10:11: error: expected ';' before 'l'
   10 |         ll l = 0, p = 0;
      |           ^~
      |           ;
shoes.cpp:12:16: error: expected ';' before 'i'
   12 |         for (ll i = 0; i < 2 * n; i++)
      |                ^~
      |                ;
shoes.cpp:12:32: error: 'n' was not declared in this scope
   12 |         for (ll i = 0; i < 2 * n; i++)
      |                                ^
shoes.cpp:12:24: error: 'i' was not declared in this scope
   12 |         for (ll i = 0; i < 2 * n; i++)
      |                        ^
shoes.cpp:16:25: error: 'l' was not declared in this scope
   16 |                         l += abs(i - p);
      |                         ^
shoes.cpp:16:38: error: 'p' was not declared in this scope
   16 |                         l += abs(i - p);
      |                                      ^
shoes.cpp:21:16: error: 'l' was not declared in this scope
   21 |         return l;
      |                ^