# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
126554 | E869120 | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 9086 ms | 1848 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bubblesort2.h"
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, Q;
pair<int, int> G[1 << 19];
vector<int> countScans(vector<int> A, vector<int> X, vector<int> V) {
N = A.size(); Q = X.size(); vector<int>ans;
for (int i = 0; i < Q; i++) {
A[X[i]] = V[i];
for (int j = 0; j < N; j++) G[j] = make_pair(A[j], j);
sort(G, G + N);
int maxn = 0;
for (int j = 0; j < N; j++) maxn = max(maxn, G[j].second - j);
ans.push_back(maxn);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |