解题思路 1. 将骑士按力量从小到大排序,到第i个骑士的时候,前面的i 1个骑士他都可以击败,找出金币最多的k个。 2. 用multiset存金币最多的k个骑士的金币数,如果多余k个,则删除金币数最小的,直到只有k个数字。 我就是因为没有用multiset在最后5分钟被hack了。 代码 c++ i ...
分类:
其他好文 时间:
2018-06-17 13:42:10
阅读次数:
256
B. Knights of a Polygonal Table time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Unlike Kn ...
分类:
其他好文 时间:
2018-06-17 10:59:20
阅读次数:
306
Problem description Hooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the ki ...
分类:
其他好文 时间:
2018-06-08 22:12:14
阅读次数:
206
Description Bessie is in Camelot and has encountered a sticky situation: she needs to pass through the forest that is guarded by the Knights of Ni. In ...
分类:
其他好文 时间:
2018-02-04 00:26:55
阅读次数:
181
http://poj.org/problem?id=2942 所写的tarjan练习题最难的一道。 说白了难在考得不是纯tarjan。 首先我们把仇恨关系处理成非仇恨关系的图,然后找双连通分量,在双连通分量里的点满足了任意一个人可以和两个(或以上)的人坐一起。 那么我们接下来要判断奇环。 发现性质: ...
分类:
其他好文 时间:
2017-11-17 18:23:17
阅读次数:
156
链接:https://vjudge.net/problem/POJ-2942 题意:给定一个无向图,求出补图,然后求补图中有多少个点不属于任何奇圈。 分析:首先是骑士有不能坐在一起的人,不好想,反过来想,相当于和其他人可以坐在一起,连一条边,围成一圈就变成了该点是否在某个点双连通分量里,所以先用Ta ...
分类:
其他好文 时间:
2017-10-14 21:52:23
阅读次数:
183
题目链接:http://www.spoj.com/problems/IM/en/ Time limit:491 ms Memory limit:1572864 kB Code length Limit:50000 B Jedi knights, Qui-Gon Jinn and his young ...
分类:
其他好文 时间:
2017-08-18 15:21:18
阅读次数:
108
Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the other knights are fun thin ...
分类:
其他好文 时间:
2017-08-10 22:24:37
阅读次数:
182
#include<cstdio> #include<cstring> #include<cmath> #include<cstdlib> #include<iostream> #include<algorithm> #include<vector> #include<map> #include<qu ...
分类:
其他好文 时间:
2017-07-30 14:53:16
阅读次数:
125
Knight Tournament Hooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the king ...
分类:
其他好文 时间:
2017-07-23 22:36:25
阅读次数:
313