Submission #852149

#TimeUsernameProblemLanguageResultExecution timeMemory
852149LucaIlieBubble Sort 2 (JOI18_bubblesort2)C++17
17 / 100
9053 ms604 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> using namespace std; vector<int> ans; vector<int> countScans( vector<int> v, vector<int> pos, vector<int> val ){ int n = v.size(); int q = pos.size(); ans.resize( q ); for ( int l = 0; l < q; l++ ) { v[pos[l]] = val[l]; ans[l] = 0; for ( int i = 0; i < n; i++ ) { int inv = 0; for ( int j = i; j >= 0; j-- ) { if ( v[j] > v[i] ) inv++; } ans[l] = max( ans[l], inv ); } } 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...