Friends Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 668 Accepted Submission(s): 313 Problem Description There are n people and m pairs of friends. For every pair of friends, they can cho
有的DP题,某一部分的状态只有两种,选或不选. 开数组记录,代价太大,转移不方便. 状态压缩意为,用 “0/1“ 表示 “选/不选“ . 把状态表示为二进制整数. There are 10 kinds of people in the world, who knows binary and who doesn't. 用位运算判断条件并转移状态. hdu 6149 Valley Numer II 题目传送门 用f[i][j]表示选到前i个点,状态为j的答案. 枚举其他两个高点. 转移之前判断之前是