# Codeforces 597C(树状数组 + dp)

@(K ACMer)

dp[i][j]=t=1...j1dp[i1][t]

code:

#include <iostream>
#include <cstdio>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <vector>
#include <string>
#include <queue>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
typedef pair<int, int> pii;
typedef unsigned long long ll;
typedef vector<int> vi;
#define xx first
#define yy second
const int mod = int(1e9) + 7, INF = 0x3fffffff, maxn = 1e5 + 41;
ll dp[12][maxn];
int n, k, ans;

ll sum(int x, int i) {
ll ret = 0;
while (i > 0) {
ret += dp[x][i];
i -= i & -i;
}
return ret;
}

void add(int y, int i, ll x) {
while (i <= n) {
dp[y][i] += x;
i += i & -i;
}
return;
}

int main(void) {
scanf("%d%d", &n, &k);
for (int i = 0; i < n; i++) {
int x;
scanf("%d", &x);
for (int i = k + 1; i >= 1; i--) {
ll temp = (i - 1 == 0) ? 1 :sum(i - 1, x - 1);
}
}
cout << sum(k + 1, n) << endl;
return 0;
}

#### 树状数组+dp（不太懂） Codeforces 597C

2015-11-20 19:01:25

#### CodeForces 597C 树状数组 dp

2017-01-16 10:29:36

#### codeforces 597C （树状数组+DP）

2016-08-19 22:37:45

#### Subsequences CodeForces - 597C 树状数组 + dp

2016-12-14 13:16:08

#### Codeforces 597C Subsequences dp + 树状数组

2015-12-21 22:10:57

#### CodeForces - 293E Close Vertices（树上点分治 + 树状数组）

2017-08-09 18:03:04

#### HDU - 3450 树状数组优化dp

2017-08-14 10:31:30

#### Codeforces 597C Subsequences 【树状数组优化DP】

2015-11-13 21:57:02

#### CodeForces 384E Propagating tree 树状数组dfs序组合使用

2017-09-02 14:47:35

#### codeforces 455B(博弈+dp)

2015-09-22 10:01:19