Submission #1054775

#TimeUsernameProblemLanguageResultExecution timeMemory
1054775aymanrsBubble Sort 2 (JOI18_bubblesort2)C++17
17 / 100
9035 ms2396 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> // #pragma GCC optimize("O3,unroll-loops") // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") using namespace __gnu_pbds; using namespace std; using Set = tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update>; std::vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){ int Q=X.size(); std::vector<int> ans(Q); int n = A.size(); for (int _=0;_<Q;_++) { A[X[_]] = V[_]; ans[_] = 0; Set s; for(int i = 0;i < n;i++){ ans[_] = max(ans[_], int(s.size()-s.order_of_key({A[i]+1, -1}))); s.insert({A[i],i}); } } 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...