-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode1316.cpp
More file actions
41 lines (32 loc) · 821 Bytes
/
Copy pathcode1316.cpp
File metadata and controls
41 lines (32 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Contest : Codeforces
* Problem : 1316E - Team Building
* Link : https://codeforces.com/contest/1316/problem/E
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fastio ios::sync_with_stdio(0); cin.tie(0);
int main() {
fastio
ll n, p, k;
cin >> n >> p >> k;
vector<ll> v(n + 1);
ll grid[n + 1][p];
for (int i = 1; i <= n; ++i) cin >> v[i];
sort(v.begin(), v.end(), greater<ll>());
for (int i = 1; i <= n; ++i)
for (int j = 0; j < p; ++j)
cin >> grid[i][j];
vector<ll> dp[n][1 << p];
for (int mask = 1; mask < (1 << p); ++mask) {
for (int i = 0; i < n; ++i) {
if (mask & (1 << i)) {
int aux = mask ^ (i << i);
// dp[i][mask] = dp[i][aux] + grid[i][j];
}
}
}
cout << dp[n][(1 << p)] << '\n';
return 0;
}