Submission #1097835

#TimeUsernameProblemLanguageResultExecution timeMemory
1097835michifiedBubble Sort 2 (JOI18_bubblesort2)C++17
Compilation error
0 ms0 KiB
vector<int> countScans(vector<int> a, vector<int> x, vector<int> v) { vector<int> ans; for (int i = 0; i < x.size(); i++) { vector<int> tmp = a; tmp[x[i]] = v[i]; int passes = 0; bool finished; for (int i = 0; i < a.size(); i++) { finished = true; for (int j = 1; j < a.size(); j++) { if (tmp[j - 1] > tmp[j]) { swap(tmp[j - 1], tmp[j]); finished = false; } } if (not finished) passes++; else break; } ans.push_back(passes); } return ans; }

Compilation message (stderr)

bubblesort2.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> countScans(vector<int> a, vector<int> x, vector<int> v) {
      | ^~~~~~