随笔分类 - 状态压缩DP
摘要:link class Solution { public: int memo[5][5][7][7][1<<10]; int getMaxGridHappiness(int m, int n, int introvertsCount, int extrovertsCount) { memset(me
阅读全文
摘要:link class Solution { public: int n; int memo[50][1<<10]; bool canDistribute(vector<int>& nums, vector<int>& quantity) { vector<int> cnt(1001); n=quan
阅读全文
摘要:link class Solution { public: int dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}}; struct Point{ int x; int y; }; int dis[105][105]; int m,n; Point S,T; int mcn
阅读全文
摘要:Link #include <bits/stdc++.h> # define LL long using namespace std; const int mod=100000000; int M, N; int grid[12]; LL dp[12][1<<12]; LL dfs(int r, i
阅读全文
摘要:Link #include <bits/stdc++.h> # define LL long using namespace std; const int INF=0x7fffffff; int n; double x[16]; double y[16]; double dp[17][1<<16];
阅读全文
摘要:Link Solution 0: class Solution { public: int m,n; int maxStudents(vector<vector<char>>& seats) { m=seats.size(); n=seats[0].size(); vector<vector<int
阅读全文
摘要:题目链接 题解: 我们可以对棋盘进行黑白染色,使得任意相邻的两个格子颜色不相同,然后进行二分图最大匹配。 Code: 1 class Solution { 2 public: 3 int N; 4 int M; 5 6 vector<vector<int>> dir{{1,0},{0,1},{-1,
阅读全文

浙公网安备 33010602011771号