diff --git a/BZOJ/1076/1076.cpp b/BZOJ/1076/1076.cpp new file mode 100644 index 00000000..daae2d14 --- /dev/null +++ b/BZOJ/1076/1076.cpp @@ -0,0 +1,45 @@ +#include +#include + +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; +} diff --git a/BZOJ/1076/data/1.in b/BZOJ/1076/data/1.in new file mode 100644 index 00000000..4f921680 --- /dev/null +++ b/BZOJ/1076/data/1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8f73df8e101a329c5f389bd6a84f5523410adedefb848565add400cbf1a9049 +size 231 diff --git a/BZOJ/1076/data/1.out b/BZOJ/1076/data/1.out new file mode 100644 index 00000000..026d8adb --- /dev/null +++ b/BZOJ/1076/data/1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e27ed1fbfe38b188d838abea0789d68fe6ec2a54bc9310157726109e13bd3cc +size 15 diff --git a/BZOJ/1076/data/10.in b/BZOJ/1076/data/10.in new file mode 100644 index 00000000..305adeae --- /dev/null +++ b/BZOJ/1076/data/10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad51faafe1b16e125f6c3823690c7c24655119a7fa28b935a561c180431a8615 +size 139 diff --git a/BZOJ/1076/data/10.out b/BZOJ/1076/data/10.out new file mode 100644 index 00000000..27c3871c --- /dev/null +++ b/BZOJ/1076/data/10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:070e9721f90575e3e5b627f34797ec0ee2b03ae987ad71fe1eb58f139a537f5e +size 12 diff --git a/BZOJ/1076/data/2.in b/BZOJ/1076/data/2.in new file mode 100644 index 00000000..0c3df3da --- /dev/null +++ b/BZOJ/1076/data/2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eee7a0182ac0c13c05e157a28d96031e415ad21139651405f98f80ae5c6af543 +size 227 diff --git a/BZOJ/1076/data/2.out b/BZOJ/1076/data/2.out new file mode 100644 index 00000000..3f4fc0f8 --- /dev/null +++ b/BZOJ/1076/data/2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:148e33b37b7ab26d9bce133fff63f493d7b9ae43b99b56f5899122762e4a04d1 +size 14 diff --git a/BZOJ/1076/data/3.in b/BZOJ/1076/data/3.in new file mode 100644 index 00000000..e755ee35 --- /dev/null +++ b/BZOJ/1076/data/3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4249d567b85ef7ef942b20b7c929149c3a950acd7cfb33e019a8ec276835c5f3 +size 71 diff --git a/BZOJ/1076/data/3.out b/BZOJ/1076/data/3.out new file mode 100644 index 00000000..315afeb6 --- /dev/null +++ b/BZOJ/1076/data/3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:727798bae4c28ff550b4ccee6f64581ac566c317117ff0e9b78b27e1f7fb20c9 +size 11 diff --git a/BZOJ/1076/data/4.in b/BZOJ/1076/data/4.in new file mode 100644 index 00000000..0879e268 --- /dev/null +++ b/BZOJ/1076/data/4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b567e341b854a55be397710a65d43ab6ea5da0681fdf061e6387d6014e113428 +size 33 diff --git a/BZOJ/1076/data/4.out b/BZOJ/1076/data/4.out new file mode 100644 index 00000000..8fb8ff15 --- /dev/null +++ b/BZOJ/1076/data/4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79703f3872dff14e19d11a65e2b9bb974fa809d81525d85ef6eb1120d533bc55 +size 9 diff --git a/BZOJ/1076/data/5.in b/BZOJ/1076/data/5.in new file mode 100644 index 00000000..096878f6 --- /dev/null +++ b/BZOJ/1076/data/5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c37fdadb32f1508c0d4cab231e99b0492ac08caccd2ba4ac8c3dcce5637a74f +size 82 diff --git a/BZOJ/1076/data/5.out b/BZOJ/1076/data/5.out new file mode 100644 index 00000000..57f08d29 --- /dev/null +++ b/BZOJ/1076/data/5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b85b7925c208792b59452c385e1d9b8fdbd8eef1aaf8e56d6c2fb193de0d36f +size 9 diff --git a/BZOJ/1076/data/6.in b/BZOJ/1076/data/6.in new file mode 100644 index 00000000..0ae10e0c --- /dev/null +++ b/BZOJ/1076/data/6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fdadcc704bb26853e91dc959898ed023cf6a7c350203a9aeb24b990cf4191e7 +size 16 diff --git a/BZOJ/1076/data/6.out b/BZOJ/1076/data/6.out new file mode 100644 index 00000000..1b48117d --- /dev/null +++ b/BZOJ/1076/data/6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65e8fe344f770e52ea7f3f8fc8633959361bb78e6ad3a178b7d3b1f16b6e2e9f +size 9 diff --git a/BZOJ/1076/data/7.in b/BZOJ/1076/data/7.in new file mode 100644 index 00000000..a51d05bf --- /dev/null +++ b/BZOJ/1076/data/7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b3812b5edf4b4472e06607124a57f6dfee5297813ce9cb43eb4498e66c18ab9 +size 64 diff --git a/BZOJ/1076/data/7.out b/BZOJ/1076/data/7.out new file mode 100644 index 00000000..69ffe68e --- /dev/null +++ b/BZOJ/1076/data/7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c191b6cd7d0603a22fdaa194e904e0c671df80c0daaf4554cf3df998cc96c7c4 +size 9 diff --git a/BZOJ/1076/data/8.in b/BZOJ/1076/data/8.in new file mode 100644 index 00000000..d04bfbc0 --- /dev/null +++ b/BZOJ/1076/data/8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d36c0d1f74e42db89f90f45c6977f175b04d14476fcc6468ab816c7499f897f8 +size 225 diff --git a/BZOJ/1076/data/8.out b/BZOJ/1076/data/8.out new file mode 100644 index 00000000..156a8530 --- /dev/null +++ b/BZOJ/1076/data/8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3315fcb9b8c4438af532112350359940c62a28136a9668529b28bc442d23c979 +size 14 diff --git a/BZOJ/1076/data/9.in b/BZOJ/1076/data/9.in new file mode 100644 index 00000000..b0ba50e7 --- /dev/null +++ b/BZOJ/1076/data/9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12026a5ff050f9ac7f7e3fa525b86733f02546114d673c28c64ac4541ad8a790 +size 22 diff --git a/BZOJ/1076/data/9.out b/BZOJ/1076/data/9.out new file mode 100644 index 00000000..93eb602e --- /dev/null +++ b/BZOJ/1076/data/9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:338dc188788f9f15aa9ed4df2ddadec8f39ae89f4717108d7d6b6ca27546261b +size 9