Submission #912511

#TimeUsernameProblemLanguageResultExecution timeMemory
912511LOLOLOBubble Sort 2 (JOI18_bubblesort2)C++17
0 / 100
9085 ms604 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define f first #define s second #define pb push_back #define ep emplace #define eb emplace_back #define lb lower_bound #define ub upper_bound #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define uniquev(v) sort(all(v)), (v).resize(unique(all(v)) - (v).begin()) #define mem(f,x) memset(f , x , sizeof(f)) #define sz(x) (int)(x).size() #define __lcm(a, b) (1ll * ((a) / __gcd((a), (b))) * (b)) #define mxx *max_element #define mnn *min_element #define cntbit(x) __builtin_popcountll(x) #define len(x) (int)(x.length()) const int N = 2e5 + 100; vector <int> countScans(vector <int> a, vector <int> x, vector <int> v) { int n = sz(a) - 1, q = sz(x); vector <int> save; for (int i = 0; i < q; i++) { a[x[i]] = v[i]; int ans = 0; for (int j = 0; j < n; j++) { int cnt = 0; for (int k = 0; k < j; k++) { cnt += (a[j] > a[k]); } ans = max(ans, cnt); } save.pb(ans); } return save; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...