摘要:
题意:给定N个组合,每个组合有a和b,现在求最长序列,满足a不升,b不降。 思路:三位偏序,CDQ分治。 但是没想到怎么输出最小字典序,我好菜啊。 最小字典序: 我们倒序CDQ分治,ans[i]表示倒序的以i为结尾的最长序列,如果当前的ans[i]==目前最大,而且满足序列要求,就输出。 阅读全文
摘要:
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 阅读全文
摘要:
Collecting one's own plants for use as herbal medicines is perhaps one of the most self-empowering things a person can do, as it implies that they hav 阅读全文