Submission #233534

# Submission time Handle Problem Language Result Execution time Memory
233534 2020-05-20T20:37:42 Z ChrisT Bubble Sort 2 (JOI18_bubblesort2) C++17
0 / 100
3524 ms 1156 KB
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using ld = long double;
#define all(x) (x).begin(),(x).end()
const int MN = 1e5 + 5, MOD = 1e9 + 7, BASE = 131;
vector<int> ret; vector<pii> na;
vector<int> countScans (vector<int> A, vector<int> X, vector<int> V) {
	int n = A.size();
	ret.resize(n);
	int q = X.size();
	na.resize(n);
	for (int j = 0; j < q; j++) {
		A[X[j]] = V[j];
		for (int i = 0; i < n; i++) na[i] = {A[i],i};
		stable_sort(all(na),[](const pii &a, const pii &b){return a.first < b.first;});
		int ans = 0;
		for (int i = 0; i < n; i++) ans = max(ans,na[i].second-i);
		ret[j] = ans;
	}
	return ret;
}
# Verdict Execution time Memory Grader output
1 Runtime error 14 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 14 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3524 ms 1156 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 14 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -