Submission #363229

#TimeUsernameProblemLanguageResultExecution timeMemory
363229teewarBubble Sort 2 (JOI18_bubblesort2)C++14
17 / 100
9038 ms540 KiB
#include "bubblesort2.h" #include <vector> 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> ret(q); for(int t = 0; t < q; ++t) { a[x[t]] = v[t]; int ans = 0; for(int i = 1; i < n; ++i) { int cnt = 0; for(int j = 0; j < i; ++j) { if(a[j] > a[i]) { ++cnt; } } ans = max(ans, cnt); } ret[t] = ans; } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...