摘要: ***状态设计值得一看dp[u][0]表示u是服务器(以下v均指任意u的子结点,son指u的所有子结点)ap[u][0]=sum{dp[v][1]}+1//错误,服务器是可以和其他服务器相邻的dp[u][0]=sum{min(dp[v][0],dp[v][1])}+1dp[u][1]表示u不是服务器 阅读全文
posted @ 2017-08-07 17:32 hehe_54321 阅读(202) 评论(0) 推荐(1) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 map nameCache; 9 int nowID,n; 10 string boss; 11 struct Edge 12 { 13 int to,next; ... 阅读全文
posted @ 2017-08-07 17:28 hehe_54321 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 2018-6-2 特殊版(vector动态数组存) 1 #pragma GCC optimize("Ofast") 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 #include<cmath> 6 #include<ve 阅读全文
posted @ 2017-08-07 17:26 hehe_54321 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 引用:点击打开链接T4607 灯·重回江湖收五杀【提高】题目描述N盏灯和N个人,最开始N盏灯都是灭的,第i个人会按下第ki(ki≤N且k>0)的开关,试问N个人操作之后有多少盏灯是亮着的。输入输出格式输入格式:输入共一个正整数N输出格式:输出共一个正整数,即N个人操作之后亮着的灯的数量。输入输出样例... 阅读全文
posted @ 2017-08-07 00:43 hehe_54321 阅读(255) 评论(0) 推荐(0) 编辑
AmazingCounters.com