Submission #1012094

#TimeUsernameProblemLanguageResultExecution timeMemory
1012094vjudge1Bubble Sort 2 (JOI18_bubblesort2)C++17
38 / 100
9060 ms3460 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector <ll>; using vi = vector <int>; vi countScans (vi a, vi wh, vi val) { vll ve(a.begin(), a.end()); ll n = a.size(); ll Q = wh.size(); vi ans; for (ll q = 0; q < Q; q++) { ve[wh[q]] = val[q]; vector <pair <ll, ll> > th; for (ll i = 0; i < n; i++) { th.push_back({ ve[i], i }); } sort(th.begin(), th.end()); ll qans = 0; for (ll i = 0; i < n; i++) { qans = max(qans, th[i].second - i); } ans.push_back(qans); } 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...