Submission #963093

#TimeUsernameProblemLanguageResultExecution timeMemory
963093PringBubble Sort 2 (JOI18_bubblesort2)C++17
38 / 100
9061 ms2748 KiB
#include <bits/stdc++.h> #include "bubblesort2.h" using namespace std; #ifdef MIKU string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m"; #define debug(x...) cout << dbmc << "[" << #x << "]: ", dout(x) void dout() { cout << dbrs << endl; } template <typename T, typename ...u> void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); } #else #define debug(...) 39 #endif #define fs first #define sc second #define mp make_pair #define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++) using ll = long long; typedef pair<int, int> pii; typedef pair<int, ll> pil; typedef pair<ll, int> pli; typedef pair<ll, ll> pll; namespace { const int MXN = 500005; int n; vector<int> a; int calc() { vector<pii> dist; FOR(i, 0, n) dist.push_back(mp(a[i], i)); sort(dist.begin(), dist.end()); int ans = 0; FOR(i, 0, n) { ans = max(ans, dist[i].sc - i); } return ans; } } vector<int> countScans(vector<int> A, vector<int> X, vector<int> V) { ::a = A; ::n = A.size(); int q = X.size(); vector<int> ans; FOR(i, 0, q) { a[X[i]] = V[i]; ans.push_back(calc()); } 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...