题解列表

筛选

机房,LCA+dp

摘要:解题思路:先求lca,在建树的过程中dp成型,最后算,我用的重链剖分求LCA注意事项:参考代码:#include<bits/stdc++.h>#define int long long#define ……

1646: 蓝桥杯算法训练VIP-比较字符串

摘要:解题思路:库里有strcmp函数,返回的就是第一个不一样的位置成功返回0注意事项:参考代码:    #include<iostream>    #include<string>    #include……

最长公共子序列

摘要:解题思路:从繁至简注意事项:c参考代码:#include <stdio.h>#include <string.h>int max(int a, int b) {    if (a >= b) retu……

万变不离其宗

摘要:解题思路:注意事项:参考代码:#include <stdio.h>    #define N 10010    int f[N], w[N], v[N];    int main() {      i……

万变不离其宗 叫我老翟

摘要:解题思路:注意事项:参考代码:#include <stdio.h>  #include <stdlib.h>    typedef struct node {      int start, end,……

蓝桥杯2022年第十三届决赛真题-齿轮

摘要:解题思路:通过列出算式 q=a1/a2*a2/a3*a3......an-2/an-1*an-1/an发现可以约掉中间部分只剩下头尾得到q=a1/an阅读题目发现q为整数,那么可得 a1%an=0且a……