Submission #1089572

# Submission time Handle Problem Language Result Execution time Memory
1089572 2024-09-16T17:02:57 Z VMaksimoski008 Bubble Sort 2 (JOI18_bubblesort2) C++17
0 / 100
9000 ms 600 KB
#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> countScans(vector<int> A, vector<int> X, vector<int> V) {
	int n = A.size(), q = X.size();

	vector<int> ans(q);

	for(int it=0; it<q; it++) {
		A[X[it]] = V[it];
		while(!is_sorted(A.begin(), A.end())) {
			ans[it]++;
			for(int i=0; i+1<n; i++) if(A[i] > A[i+1]) swap(A[i], A[i+1]);
		}
	}

	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9006 ms 600 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -