一点点决策单调性 艹了天天都被不知道的知识点教育,知道的又做不出来。 :lei: 在动态规划中,决策单调性指对于j<j′j < j'j<j′,f(j′)f(j')f(j′)的最佳转移f(i′)f(i')f(i′)位置i′i'i′一定不小于f(j)f(j)f(j)的iii。 假设 f(r)=minf(k−1)+w(k,r)f(r)=\min{f(k-1)+w 2020-03-23 学习
[HDU 6363] bookshelf Patrick Star bought a bookshelf, he named it ZYG !! Patrick Star has N book . The ZYG has K layers (count from 1 to K) and there is no limit on the capacity of each layer ! Now Patrick want to put all 2020-03-21 code
一点点拉格朗日插值 抄起我的混凝土数学,复习了会上升下降积分,看了看斯特林数和伯努利数。结果误把伯努利数的递推式看成了O(n)O(n)O(n)的,改了半天一到3次方以上就翻车,这才反应过来。 8会啊…找了很长时间才知道是拉格朗日插值。 有这么一条定理。 平面上的n+1个点可以确定一个n次多项式。 而∑ip\sum i^p∑ip是一个p+1p+1p+1次多项式,况且在p≤1000000p \leq 1000000p 2020-03-19 学习
Spring Training 3 HDU6319 Ascending Rating Before the start of contest, there are n ICPC contestants waiting in a long queue. They are labeled by 1 to n from left to right. It can be easily found that the i-th contest 2020-03-19 code
[???] Builds Sequences Alice 想要得到一个长度为 n 的序列,序列中的数都是不超过 m 的正整数,而且这 n 个数的和是 p 的倍数。 Alice 还希望,这 n 个数中,至少有一个数是质数。 Alice 想知道,有多少个序列满足她的要求。 1≤n≤109,1≤m≤2×107,1≤p≤1001 \leq n \leq 10 ^ 9, 1 \leq m \leq 2 \times 10 ^ 7, 1 \leq p \ 2020-03-18 code #快速幂
[CF 1322C] Instant Noodles Wu got hungry after an intense training session, and came to a nearby store to buy his favourite instant noodles. After Wu paid for his purchase, the cashier gave him an interesting task. You are give 2020-03-08 code
[CF 1320C] World of Darkraft: Battle for Azathoth Roma is playing a new expansion for his favorite game World of Darkraft. He made a new character and is going for his first grind. Roma has a choice to buy exactly one of 𝑛 different weapons and exac 2020-03-08 code
[CF 1321C] Remove Adjacent 拓展 没注意到数据范围是100。 You are given a string 𝑠 consisting of lowercase Latin letters. Let the length of 𝑠 be |𝑠|. You may perform several operations on this string. In one operation, you can choose some in 2020-03-02 code
[CF 1295E] Permutation Separation You are given a permutation 𝑝1,𝑝2,…,𝑝𝑛 (an array where each integer from 1 to 𝑛 appears exactly once). The weight of the 𝑖-th element of this permutation is 𝑎𝑖. At first, you separate your per 2020-02-28 code
C++新标准特性初探 说实话,这一套东西东拼西凑到处取经,不过有些还挺香的. 目前对于14,17的特性,GCC和Clang都完成了很好的适配.在C++20上,下面提到的特性都在最新的版本里完成了绝大多数. 标准定得爽,到了实现就凉凉. auto 这个关键字…是真的…相信不久之后c++只需要下面一个参数. 123auto auto(auto...){ return auto;} 这个东西,就是把变量 2020-02-23 学习