Submission #1054633

#TimeUsernameProblemLanguageResultExecution timeMemory
1054633aymanrsBubble Sort 2 (JOI18_bubblesort2)C++17
17 / 100
9072 ms860 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") using namespace std; std::vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){ int Q=X.size(); std::vector<int> ans(Q); int n = A.size(); int cop[n]; for (int j=0;j<Q;j++) { A[X[j]] = V[j]; for(int i = 0;i < n;i++) cop[i]=A[i]; ans[j]=0; while(!is_sorted(cop, cop+n)){ ans[j]++; for(int i = 0;i < n-1;i++) if(cop[i] > cop[i+1]) swap(cop[i],cop[i+1]); } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...