
状压二进制暴力枚举
paranoidZ
这个作者很懒,什么都没留下…
展开
-
7段码(dfs,二进制枚举)
对每一段都有两种情况,选和不选,二进制枚举每一种情况(或则dfs),然后判断选择的段会组成几个连通块,当连通块的数量为1时答案+1 code: #include<iostream> #include<cstring> using namespace std; const int N = 100; int head[N],e[N],ne[N]; int cnt; int ans; bool st[10]; int fa[10]; void add(int u,int.原创 2020-10-30 22:20:47 · 1377 阅读 · 0 评论 -
AtCoder Beginner Contest 167 C : Skill Up
题目 C - Skill Up Time Limit: 2 sec / Memory Limit: 1024 MB Score :300300points Problem Takahashi, who is a novice in competitive programming, wants to learnMMalgorithms. Initially, hisunderstanding levelof each of theMMalgorithms is00. Takaha...原创 2020-05-12 11:06:16 · 456 阅读 · 0 评论