T1. 组队
考虑状压 DP。复杂度 \(O(2^n\times n^3)\)。实际上严重跑不满因为你只需要考虑 \(1\) 的个数为 \(3\) 的倍数的状态。
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define…
pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …
pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …