Submission #363232

#TimeUsernameProblemLanguageResultExecution timeMemory
363232teewarBubble Sort 2 (JOI18_bubblesort2)C++14
17 / 100
9028 ms620 KiB
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #pragma GCC optimize("no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,mmx,abm,popcnt") #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...