Submission #589989

# Submission time Handle Problem Language Result Execution time Memory
589989 2022-07-05T12:54:12 Z MODDI Bubble Sort 2 (JOI18_bubblesort2) C++14
0 / 100
9000 ms 620 KB
#include "bubblesort2.h"
//#include "grader.cpp"
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define mp make_pair
#define pb push_back
int q,n;
vector<int> countScans(vector<int> arr,vector<int> X, vector<int> V){
	q = X.size();
	n = arr.size();
	vi ans;
	for(int i = 0; i < q; i++){
		arr[X[i]] = V[i];
		int rez = 0;
		for(int j = 0; j < n; j++){
			bool done = false;
			for(int k = j + 1; k < n; k++){
				if(arr[j] > arr[k]){
					swap(arr[j], arr[k]);
					if(!done){
						done = true;
						rez++;
					}
				}
				else
					continue;
			}
		}
		ans.pb(rez);
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 83 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 83 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9010 ms 620 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 83 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -