思维
碳碳双键
这个作者很懒,什么都没留下…
展开
-
Codeforces 1209 D.Cow and Snacks
题意:n种小吃,每种一个。k个人,每人有2个喜欢的小吃。当轮到某个人时这个人会把他喜欢的2种小吃都吃掉,如果一种都没有吃到他就会沮丧。要求可能的最少的沮丧的人数。一开始没想到这个题要怎么搞,现在看来还是挺简单的。只需要建一个图,对于每个人,将他喜欢的两种食物连起来。然后就只要用并查集维护一下就行了。代码:#include <cstdio>#include <cstring>#include <iostream>#include <algorith原创 2020-05-28 13:14:01 · 276 阅读 · 0 评论 -
计蒜客 43513 Beer Mugs
Damian is a beer mug collector. His collection fifills most of the shelves in his vintage woodencabinet where all mugs are proudly displayed. The mugs are of various brands. There might be,and often a...原创 2020-03-02 14:30:11 · 380 阅读 · 0 评论