寒假训练
正经人谁在树上做dp
此人不懒但也没写签名
展开
-
2020牛客寒假算法基础集训营1 J u's的影响力
2020牛客寒假算法基础集训营1J u’s的影响力题意如题。思路我们可以发现,x和y的幂次是斐波那契数列的某一项,ab的幂次的递推公式为F[i] = F[i-1] + F[i-2] +1。所以我们可以用矩阵快速幂跑出幂次。但是由于幂次过大,无法直接求解,所以我们需要再套一个欧拉降幂,也就是幂次的递推时的模数为MOD-1。坑点要注意幂次模完之后可能会是0。啊啊啊啊啊!卡了我一晚上...原创 2020-02-05 02:16:55 · 1637 阅读 · 0 评论 -
2020牛客寒假算法基础集训营2 H 施魔法 - BenFromHRBUST
2020牛客寒假算法基础集训营2H 施魔法题意如题。思路动态规划。f [ ]为DP数组,DP方程如下:坑点没想到可以一维解。。。Code#include <bits/stdc++.h>#include <cstdio>#include <algorithm>#include <cstring>#include <...原创 2020-02-06 20:01:51 · 310 阅读 · 0 评论 -
寒假训练20200130(补题)
C - Unusual Product CodeForces - 405CProblem DescriptionLittle Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.The dot prod...原创 2020-02-01 00:53:41 · 247 阅读 · 0 评论 -
寒假训练20200126(补题)
B - Berstagram CodeForces - 1250AProblem DescriptionPolycarp recently signed up to a new social network Berstagram. He immediately published n posts there. He assigned numbers from 1 to n to all pos...原创 2020-01-27 01:12:40 · 257 阅读 · 0 评论 -
寒假训练20200116
B Codeforces 1267EProblem DescriptionByteburg Senate elections are coming. Usually “United Byteland”, the ruling Byteland party, takes all the seats in the Senate to ensure stability and sustainable...原创 2020-01-17 00:23:15 · 693 阅读 · 0 评论 -
寒假训练20200114(补题)
A CodeForces 1255C League of LeesinsProblem DescriptionBob is an avid fan of the video game “League of Leesins”, and today he celebrates as the League of Leesins World Championship comes to an end!...原创 2020-01-15 22:36:55 · 465 阅读 · 0 评论