Submission #761458

#TimeUsernameProblemLanguageResultExecution timeMemory
761458happypotatoBubble Sort 2 (JOI18_bubblesort2)C++17
0 / 100
9100 ms596 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> using namespace std; vector<int> countScans(vector<int> a, vector<int> X, vector<int> V) { int n = a.size(); int Q = X.size(); vector<int> finans; for (int i = 0; i < Q; i++) { a[X[i]] = V[i]; int ans = 0; for (int j = 0; j < n; j++) { for (int k = j + 1; k < n; k++) { if (a[j] > a[k]) ans = max(ans, k - j); } } finans.push_back(ans); } return finans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...