摘要:
一定要粘上去啊,亲测快两倍 阅读全文
摘要:
A palindrome partition is the partitioning of a string such that each separate substring is a palindrome. For example, the string "ABACABA" could be p 阅读全文
摘要:
最近在水简单DP题,遇到了两道层层递进的DP题,于是记录一下 一、最大子段和 题意: 给出一个长度为n(n<=1e5)的序列,求连续子段的最大值 比如说2 3 -4 5 的最大值是6 而 2 3 -6 7 的最大值为7 样例输入 6 5 4 3 -15 -12 13 样例输出 13 思路一(前缀和) 阅读全文
摘要:
問題文N を 1 以上の整数とします。 長さ 3N の数列 a=(a1,a2,…,a3N) があります。 すぬけ君は、a からちょうど N 個の要素を取り除き、残った 2N 個の要素を元の順序で並べ、長さ 2N の数列 a' を作ろうとしています。 このとき、a' のスコアを (a'の前半N要素の総 阅读全文
摘要:
You are given a tree with N nodes. The tree nodes are numbered from 1 to N and have colors C1, C2,. . . , CN initially. You have to handle M instructi 阅读全文
摘要:
This task is very simple. Given a string S of length n and q queries each query is on the format i j k which means sort the substring consisting of th 阅读全文
摘要:
問題文N 個の都市があり、K 本の道路と L 本の鉄道が都市の間に伸びています。 i 番目の道路は pi 番目と qi 番目の都市を双方向に結び、 i 番目の鉄道は ri 番目と si 番目の都市を双方向に結びます。 異なる道路が同じ 2 つの都市を結ぶことはありません。同様に、異なる鉄道が同じ 2 阅读全文
摘要:
We'll call an array of n non-negative integers a[1], a[2], ..., a[n] interesting, if it meets m constraints. The i-th of the m constraints consists of 阅读全文
摘要:
Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven which can bake several types o 阅读全文