Submission #852141

#TimeUsernameProblemLanguageResultExecution timeMemory
852141LucaIlieBubble Sort 2 (JOI18_bubblesort2)C++17
0 / 100
9041 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++ ) { for ( int j = i; j >= 0; j-- ) { if ( v[j] > v[i] ) ans[l] = max( ans[l], i - j ); } } } 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...