Submission #589991

#TimeUsernameProblemLanguageResultExecution timeMemory
589991MODDIBubble Sort 2 (JOI18_bubblesort2)C++14
0 / 100
9008 ms468 KiB
#include<bits/stdc++.h> //#include "bubblesort2.h" //#include "grader.cpp" using namespace std; #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define vi vector<int> #define vl vector<ll> #define mp make_pair #define pb push_back int q,n; vector<int> countScans(vector<int> arr,vector<int> X, vector<int> V){ q = X.size(); n = arr.size(); vi ans; for(int i = 0; i < q; i++){ arr[X[i]] = V[i]; int rez = 0; for(int j = 0; j < n; j++){ bool done = false; for(int k = j + 1; k < n; k++){ if(arr[j] > arr[k]){ swap(arr[j], arr[k]); if(!done){ done = true; rez++; } } else continue; } } ans.pb(rez); } 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...