Submission #363302

#TimeUsernameProblemLanguageResultExecution timeMemory
363302buyolitsezBubble Sort 2 (JOI18_bubblesort2)C++17
0 / 100
9092 ms620 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> using namespace std; //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") //#pragma GCC optimize("O3") //#pragma GCC optimize("unroll-loops") std::vector<int> countScans(std::vector<int> a,std::vector<int> x,std::vector<int> v){ int n = a.size(), q = x.size(); vector <int> s(q); vector<int> b = a; for(int f = 0; f < q; ++f) { a[x[f]] = v[f]; b[x[f]] = v[f]; int cnt = 0; for (int i = 1; i < n; ++i) { bool flag = 0; for (int j = 1; j < n; ++j) { if (a[j] < a[j - 1]) { swap(a[j], a[j - 1]); flag = 1; } } if (!flag) { s[f] = i; break; } } swap(a, b); } return s; }

Compilation message (stderr)

bubblesort2.cpp: In function 'std::vector<int> countScans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:17:13: warning: unused variable 'cnt' [-Wunused-variable]
   17 |         int cnt = 0;
      |             ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...