摘要:
现在给你一个长度为n的整数序列,其中有一些数已经模糊不清了,现在请你任意确定这些整数的值, 使得最长上升子序列最长。(为何最长呢?因为hxy向来对自己的rp很有信心) Input 第一行一个正整数n 接下来n行第i行格式如下 K x:表示第i个数可以辨认且这个数为x N:表示第i个数一个已经辨认不清 阅读全文
摘要:
一个包含四个点的完全图,可以在任意节点出发,可以在任意节点结束,给出每个点被经过的次数,求有多少种合法的遍历序列。如果两个序列至少有一位是不同的,则认为它们不相同。 Input Sample Output 题意:给a个A,b个B,c个C,d个D,求有少种排列,使得相邻的两个不同。 思路:用容斥来做, 阅读全文
摘要:
As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: Yuta ha 阅读全文
摘要:
A thief made his way to a shop. As usual he has his lucky knapsack with him. The knapsack can contain k objects. There are n kinds of products in the 阅读全文
摘要:
There is a connected undirected graph with weights on its edges. It is guaranteed that each edge appears in at most one simple cycle. Assuming that th 阅读全文
摘要:
Samwell Tarly is learning to draw a magical matrix to protect himself from the White Walkers. the magical matrix is a matrix with n rows and m columns 阅读全文
摘要:
【BZOJ3622】已经没有什么好害怕的了 Description Input Output Sample Input 4 2 5 35 15 45 40 20 10 30 Sample Output 4 HINT 输入的2*n个数字保证全不相同。 输入的2*n个数字保证全不相同。 题意:给定a数组 阅读全文
摘要:
Recently, TeaTree acquire new knoledge gcd (Greatest Common Divisor), now she want to test you. As we know, TeaTree is a tree and her root is node 1, 阅读全文
摘要:
Declare: k=∑ m i=1 φ(i∗n) mod 1000000007 k=∑i=1mφ(i∗n) mod 1000000007 n n is a square-free number. φ φ is the Euler's totient function. find: ans=k k 阅读全文
摘要:
There are n n apples on a tree, numbered from 1 1 to n n . Count the number of ways to pick at most m m apples. InputThe first line of the input conta 阅读全文