Submission #391533

#TimeUsernameProblemLanguageResultExecution timeMemory
391533muhammad_hokimiyonBubble Sort 2 (JOI18_bubblesort2)C++14
17 / 100
9091 ms612 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];
        int res = 0;
        for(int j = 0; j < n; j++){
            int cnt = 0;
            for(int h = 0; h < j; h++){
                cnt += (A[h] > A[j]);
            }
            res = max(res, cnt);
        }
        answer.push_back(res);
    }
    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...