Submission #994062

#TimeUsernameProblemLanguageResultExecution timeMemory
994062TgX_2Arranging Shoes (IOI19_shoes)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int count_swaps(vector<int> s) { int cnt = 0; int n = s.size(); for(int i = 0; i < n; i++) { if (i & 1 and a[i] < 0) cnt++; else if (i % 2 == 0 and a[i] > 0) cnt++; } return cnt; }

Compilation message (stderr)

shoes.cpp: In function 'int count_swaps(std::vector<int>)':
shoes.cpp:9:23: error: 'a' was not declared in this scope
    9 |         if (i & 1 and a[i] < 0) cnt++;
      |                       ^