acm
qq_39479426
井底之蛙
展开
-
1868: 潜在好友
Description小X在搬砖写一个论坛,这个时候老板突然想到一个功能,让小X今天赶快实现。大概就是如果某个人是你好友的好友那么他的头像上面会有特殊的标志。小X想不到较好的办法来解决如何验证两个人是不是好友的好友,现在向你求助。Input第一行是一个整数T(1<=T<=100),代表数据组数。 每组数据第一行是两个整数n,m(1<=n,m<=10000),代表这两个人的好...原创 2018-04-09 00:00:13 · 132 阅读 · 0 评论 -
Codeforces 1006F
There is a rectangular grid of size n×mn×m . Each cell has a number written on it; the number on the cell (i,ji,j ) is ai,jai,j . Your task is to calculate the number of paths from the upper-left cell...原创 2018-07-22 15:35:14 · 184 阅读 · 0 评论 -
Codeforce 1006E
In this problem you will have to help Berland army with organizing their command delivery system. There are nn officers in Berland army. The first officer is the commander of the army, and he does no...原创 2018-07-21 23:24:37 · 182 阅读 · 0 评论 -
Codeforce3 1003E
You are given three integers nn , dd and kk . Your task is to construct an undirected tree on nn vertices with diameter dd and degree of each vertex at most kk , or say that it is impossible. An und...原创 2018-07-23 18:46:13 · 175 阅读 · 0 评论 -
csuoj 古怪的行列式
Description这几天,子浩君潜心研究线性代数。 行列式的值定义如下: 其中,τ(j1j2...jn)为排列j1j2...jn的逆序数。子浩君很厉害的,但是头脑经常短路,所以他会按照行列式值的定义去计算,这个行列式子浩君也还是能算对的。但是,在计算的过程中,如果出现连续三行选取的元素为83(S),83(S),82(R)的话,子浩君会忍不住拿走它们:-D,然后这三个数的乘积将被视为1,而其它数...原创 2018-06-18 00:10:54 · 282 阅读 · 0 评论 -
csuoj 给自己出题的小X
Description小X学习了dfs,为了练习搜索,开始给自己出题玩。 玩着玩着,一会把自己难住了,一会又被自己难倒了,真是有趣诶! 小X出的题: 现在有N个不同的正整数,求它们可以组成多少个这样的集合,满足:集合内的元素数量S>1集合内任意两个数的差的绝对值都大于集合内的元素数量。Input第一行,一个正整数T(T<=20)表示数据组数。对于每组数据,有两行。第一行为一个正整数N(...原创 2018-06-15 00:18:23 · 261 阅读 · 0 评论 -
V: 小M的移动硬盘
V: 小M的移动硬盘 Description最近小M买了一个移动硬盘来储存自己电脑里不常用的文件。但是他把这些文件一股脑丢进移动硬盘后,觉得这些文件似乎没有被很好地归类,这样以后找起来岂不是会非常麻烦? 小M最终决定要把这些文件好好归类,把同一类地移动到一起。所以现在小M有了这几种操作:1 u 表示把编号为u的文件放到最上面2 u 表示把编号为u的文件放到最下面3 u v 表示把编号...原创 2018-06-04 00:29:32 · 305 阅读 · 0 评论 -
Swap Digits
DescriptionNow we have a number, you can swap any two adjacent digits of it, but you can not swap more than K times. Then, what is the largest probable number that we can get after your swapping?Input...原创 2018-05-05 23:32:10 · 107 阅读 · 0 评论 -
A: ACM小组的古怪象棋
DescriptionACM小组的Samsara和Staginner对中国象棋特别感兴趣,尤其对马(可能是因为这个棋子的走法比较多吧)的使用进行深入研究。今天他们又在 构思一个古怪的棋局:假如Samsara只有一个马了,而Staginner又只剩下一个将,两个棋子都在棋盘的一边,马不能出这一半棋盘的范围,另外这 一半棋盘的大小很奇特(n行m列)。Samsara想知道他的马最少需要跳几次才能吃掉St...原创 2018-05-01 23:30:40 · 83 阅读 · 0 评论 -
csuoj1005: Binary Search Tree analog
1005: Binary Search Tree analog DescriptionBinary Search Tree, abbreviated as BST, is a kind of binary tree maintains the following property:each node has a Key value, which can be used to compare wi...原创 2018-04-05 00:30:42 · 238 阅读 · 0 评论