# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
411675 | Dormi | Swap Swap Sort (CCO21_day1problem1) | C++14 | 1984 ms | 71212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template <typename T>
int sz(const T &a){return int(a.size());}
const int MN=1e5+1,MB=100;
int arr[MN];
vector<int> locs[MN];
vector<ll> pc[MN];
int ind[MN];
int ord[MN];
ll bit[MN];
int n,k,q;
void update(int loc, ll val){
for(;loc<=k;loc+=loc&-loc)bit[loc]+=val;
}
ll query(int loc){
ll res=0;
for(;loc>0;loc-=loc&-loc)res+=bit[loc];
return res;
}
int main(int argc, char* argv[]){//bubble sort, count inversions. maintain number of adjacent inversions? sqrt is possible..
cin.tie(NULL);
ios_base::sync_with_stdio(false);
cin>>n>>k>>q;
ll tot=0;
for(int i=1;i<=n;i++){
cin>>arr[i];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |