# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1011789 | dimashhh | Permutation (APIO22_perm) | C++17 | 884 ms | 852 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 "perm.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[150],t[150];
ll K;
int n;
void upd(int pos,ll val){
while(pos <= n){
t[pos] += val;
pos += pos & -pos;
}
}
ll sum(int p){
ll ret = 0;
while(p > 0){
ret += t[p];
p -= (p & -p);
}
return ret;
}
ll sum(int l,int r){
return sum(r) - sum(l - 1);
}
ll calc(vector<int> x){
ll S = 1;
n = (int)x.size();
for(int i = 0;i < n;i++){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |