0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 23:08:47 +00:00

#758. 【SCOI2008】奖励关

https://sjzezoj.com/submission/64246
This commit is contained in:
Baoshuo Ren 2022-11-14 11:28:09 +08:00
parent cd006384fc
commit 28a06a7aca
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
22 changed files with 108 additions and 0 deletions

45
S2OJ/758/758.cpp Normal file
View File

@ -0,0 +1,45 @@
#include <iostream>
#include <iomanip>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 15 + 2,
K = 105;
int k, n, p[N], s[N];
double f[K][1 << N];
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> k >> n;
for (int i = 1, x; i <= n; i++) {
cin >> p[i];
while (cin >> x, x) {
s[i] |= 1 << x - 1;
}
}
for (int i = k; i; i--) {
for (int t = 0; t < 1 << n; t++) {
for (int j = 1; j <= n; j++) {
if ((t & s[j]) == s[j]) {
f[i][t] += std::max(f[i + 1][t], f[i + 1][t | (1 << j - 1)] + p[j]);
} else {
f[i][t] += f[i + 1][t];
}
}
f[i][t] /= n;
}
}
cout << std::fixed << std::setprecision(6) << f[1][0] << endl;
return 0;
}

BIN
S2OJ/758/data/data1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data1.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data10.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data10.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data2.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data3.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data4.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data5.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data6.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data7.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data7.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data8.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data8.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data9.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/data9.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/758/data/problem.conf (Stored with Git LFS) Normal file

Binary file not shown.