Submission #1322539

#TimeUsernameProblemLanguageResultExecution timeMemory
1322539Robert_juniorBubble Sort 2 (JOI18_bubblesort2)C++20
0 / 100
9087 ms568 KiB
#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
	int q = X.size(), n = A.size();
	vector<int> answer(q);
	for (int j=0;j<q;j++) {
		A[X[j]] = V[j];
		int ans = 0;
		for(int i = 0; i < n; i++){
		    int cnt = 0;
		    for(int j = i + 1; j < n; j++){
		        if(A[j] < A[i]) cnt++;
		    }
		    ans = max(ans, cnt);
		}
		answer[j ] = ans;
	}
	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...