Submission #589991

# Submission time Handle Problem Language Result Execution time Memory
589991 2022-07-05T12:55:14 Z MODDI Bubble Sort 2 (JOI18_bubblesort2) C++14
0 / 100
9000 ms 468 KB
#include<bits/stdc++.h>
//#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 57 ms 292 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 292 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9008 ms 468 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 292 KB Output isn't correct
2 Halted 0 ms 0 KB -