Submission #389717

#TimeUsernameProblemLanguageResultExecution timeMemory
389717muhammad_hokimiyonBubble Sort 2 (JOI18_bubblesort2)C++14
0 / 100
9085 ms592 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> using namespace std; vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){ int Q=X.size(); vector<int> answer; int n = (int)A.size(); for(int i = 0; i < Q; i++){ A[X[i]] = V[i]; auto b = A; for(int it = 0; it <= n; it++){ bool f = false; for(int j = 0; j + 1 < n; j++){ if(b[j] > b[j + 1]){ swap(b[j], b[j + 1]); f = true; } } if(!f){ answer.push_back(it); break; } } } return answer; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...