Submission #115349

#TimeUsernameProblemLanguageResultExecution timeMemory
115349JustasZBubble Sort 2 (JOI18_bubblesort2)C++14
0 / 100
7 ms1408 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define all(a) a.begin(), a.end() #define sz(a) (int)a.size() #define x first #define y second #define debug(...) cout << "[" << #__VA_ARGS__ << ": " << __VA_ARGS__ << "]\n" #define rd() abs((int)rng()) using namespace std; using namespace __gnu_pbds; template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; typedef long long ll; typedef long double ld; typedef pair<int, int>pii; const int maxn = 5e5 + 100; const int mod = 1e9 + 7; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); int n, q; int get(vector<int>v) { ordered_set<int>se; int ret = 0; for(int i = 0; i < sz(v); i++) { ret = max(ret, (int)se.order_of_key(-v[i])); se.insert(-v[i]); } return ret; } vector<int>countScans(vector<int>arr, vector<int>pos, vector<int>val) { n = sz(arr); q = sz(pos); vector<int>ans; for(int i = 0; i < q; i++) { arr[pos[i]] = val[i]; ans[i] = get(arr); } 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...