Live2d Test Env

随笔分类 -  OJ---HDU

上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要:题意:给定A,B长度相同的字符串,Q次操作,修改操作位单个字符修改,查询操作为询问从某点开始有多少连续相同的字符。 思路:我们把不相同的设为1,相同的设为0,那么询问就是找下一个为1的为位置,可以用线段树解决,可以用set的lower_bound解决,这里用bitset的Find_next函数,效率 阅读全文
posted @ 2018-11-06 10:40 nimphy 阅读(929) 评论(0) 推荐(0)
摘要:题意:给定N个组合,每个组合有a和b,现在求最长序列,满足a不升,b不降。 思路:三位偏序,CDQ分治。 但是没想到怎么输出最小字典序,我好菜啊。 最小字典序: 我们倒序CDQ分治,ans[i]表示倒序的以i为结尾的最长序列,如果当前的ans[i]==目前最大,而且满足序列要求,就输出。 阅读全文
posted @ 2018-11-05 23:07 nimphy 阅读(314) 评论(0) 推荐(0)
摘要:Given you a sequence of number a 1, a 2, ..., a n, which is a permutation of 1...n. You need to answer some queries, each with the following format: G 阅读全文
posted @ 2018-11-05 15:35 nimphy 阅读(331) 评论(0) 推荐(0)
摘要:In graph theory, the complement of a graph G is a graph H on the same vertices such that two distinct vertices of H are adjacent if and only if they a 阅读全文
posted @ 2018-11-04 19:49 nimphy 阅读(363) 评论(0) 推荐(0)
摘要:。。。懒得说什么了 阅读全文
posted @ 2018-11-01 21:47 nimphy 阅读(216) 评论(0) 推荐(0)
摘要:Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to wal 阅读全文
posted @ 2018-11-01 16:47 nimphy 阅读(151) 评论(0) 推荐(0)
摘要:The math department has been having problems lately. Due to immense amount of unsolicited automated programs which were crawling across their pages, t 阅读全文
posted @ 2018-11-01 14:58 nimphy 阅读(234) 评论(0) 推荐(0)
摘要:题意:T组数据,给次给出N,M,K,多少种方案,用[0,N-1]范围的数,表示一个M排列,其和为K; 思路:隔板法,不限制[0,N-1]的时候答案是C(M+K-1,M-1);那么我们减去至少一个>=N,加上至少两个>=N....即可得到答案。 假设至少一个隔板里的数大于大于N,我们从这个隔板里抽出N 阅读全文
posted @ 2018-11-01 11:11 nimphy 阅读(183) 评论(0) 推荐(0)
摘要:一个包含四个点的完全图,可以在任意节点出发,可以在任意节点结束,给出每个点被经过的次数,求有多少种合法的遍历序列。如果两个序列至少有一位是不同的,则认为它们不相同。 Input Sample Output 题意:给a个A,b个B,c个C,d个D,求有少种排列,使得相邻的两个不同。 思路:用容斥来做, 阅读全文
posted @ 2018-10-30 18:40 nimphy 阅读(345) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-10-25 21:43 nimphy 阅读(370) 评论(0) 推荐(0)
摘要: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  阅读全文
posted @ 2018-10-24 16:15 nimphy 阅读(340) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-10-23 17:00 nimphy 阅读(528) 评论(0) 推荐(0)
摘要:Yellowstar likes integers so much that he listed all positive integers in ascending order,but he hates those numbers which can be written as a^b (a, b 阅读全文
posted @ 2018-10-23 10:38 nimphy 阅读(239) 评论(0) 推荐(0)
摘要:Tom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has a ability. Now, Tom is g 阅读全文
posted @ 2018-10-23 09:09 nimphy 阅读(179) 评论(0) 推荐(0)
摘要:题面太丑了,就不复制了。 题意:F1=A; F2=B; Fn=D*Fn-1+C*Fn-2+P/i;求Fn。 思路:根据P/i的值划分区间,每个区间矩阵求。 带常数的矩阵: 阅读全文
posted @ 2018-10-22 09:42 nimphy 阅读(159) 评论(0) 推荐(0)
摘要:There are n numbers 3^0, 3^1, . . . , 3^n-1. Each time you can choose a subset of them (may be empty), and then add them up. Count how many numbers ca 阅读全文
posted @ 2018-10-21 20:02 nimphy 阅读(176) 评论(0) 推荐(0)
摘要:Senior Pan fails in his discrete math exam again. So he asks Master ZKC to give him graph theory problems everyday. The task is simple : ZKC will give 阅读全文
posted @ 2018-10-21 09:26 nimphy 阅读(533) 评论(0) 推荐(0)
摘要:There is a tree having N vertices. In the tree there are K monkeys (K <= N). A vertex can be occupied by at most one monkey. They want to remove some 阅读全文
posted @ 2018-10-20 21:19 nimphy 阅读(387) 评论(0) 推荐(0)
摘要:Do you like painting? Little D doesn't like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy pa 阅读全文
posted @ 2018-10-19 20:05 nimphy 阅读(361) 评论(0) 推荐(0)
摘要:Bob's school has a big playground, boys and girls always play games here after school. To protect boys and girls from getting hurt when playing happil 阅读全文
posted @ 2018-10-19 16:27 nimphy 阅读(559) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 ··· 9 下一页