Submission #66308

#TimeUsernameProblemLanguageResultExecution timeMemory
66308zadrgaBubble Sort 2 (JOI18_bubblesort2)C++14
38 / 100
9074 ms4632 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fi first #define se second #define INF (int) (2 * 1e9) #define MOD (1000 * 1000 * 1000 + 7) #define maxn 100111 typedef long long ll; typedef long double ld; typedef pair<int, int> pii; pii cur[maxn]; int solve(vector<int> &a){ int n = a.size(); for(int i = 0; i < n; i++) cur[i] = mp(a[i], i); sort(cur, cur + n); int ret = 0; for(int i = 0; i < n; i++){ // cout << i << " " << cur[i].fi << " " << cur[i].se << endl; int diff = cur[i].se - i; ret = max(ret, diff); } return ret; } vector<int> countScans(vector<int> A, vector<int> X, vector<int> V){ int q = X.size(); vector<int> ans(q); for(int i = 0; i < q; i++){ A[X[i]] = V[i]; ans[i] = solve(A); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...