# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
577334 | handlename | Permutation (APIO22_perm) | C++17 | 1089 ms | 456 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;
#define pb push_back
#define mp make_pair
const int MOD=1e9+7;
int n;
long long num[63];
long long ft[201];
void upd(int x,long long v){
while (x<=n){
ft[x]+=v;
if (ft[x]>1e18) ft[x]=1e18+1;
x+=x&-x;
}
}
long long qry(int x){
long long res=0;
while (x>0){
res+=ft[x];
if (res>1e18) res=1e18+1;
x-=x&-x;
}
return res;
}
int lol(vector<int> arr){
n=arr.size();
long long res=1;
for (int i=1;i<=n;i++) ft[i]=0;
for (auto i:arr){
long long cur=qry(i+1)+1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |