Submission #1341001

#TimeUsernameProblemLanguageResultExecution timeMemory
1341001aaaaaaaaBubble Sort 2 (JOI18_bubblesort2)C++20
17 / 100
9092 ms580 KiB
#include <bits/stdc++.h>
#include "bubblesort2.h"
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> answer(Q);
	for (int j=0;j<Q;j++) {
		A[X[j]] = V[j];
		int ans = 0;
		for(int x = 0; x < (int) A.size(); ++x){
			int cnt = 0;
			for(int y = x; y >= 0; --y){
				if(A[y] > A[x]) cnt += 1;
			}
			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...