夜语声烦-
夜语声烦-
全部文章
分类
题解(33)
归档
标签
去牛客网
登录
/
注册
夜语声烦-的博客
全部文章
(共35篇)
题解 | #小G有一个大树#
#include <iostream> #include <cstring> using namespace std; const int N = 1010; int n; int h[N], e[N], ne[N], idx; int si[N];//每个节点对应的...
C++
2023-03-05
0
309
题解 | #寻找道路#
#include <iostream> #include <cstring> #include <queue> using namespace std; const int N = 10010, M = 2e5 + 10; int n, m, s, t; i...
2023-02-26
0
385
题解 | #[HNOI2015]菜肴制作#
#include <iostream> #include <cstring> #include <queue> #include <vector> using namespace std; const int N = 1e5 + 10; int ...
2023-02-06
0
453
题解 | #矩阵 A×B#
矩阵快速幂模板题 #include <iostream> using namespace std; const int N = 110; int n, m, p; int a[N][N], b[N][N], c[N][N]; int main() { cin >&g...
C++
2022-10-27
0
427
题解 | #Fibonacci 第 n 项#
思路: 由于数据范围过大,所以递推已经无法满足要求,尝试将递推式的运算转换为矩阵的运算 用 fif_ifi 来表示斐波那契数列的第 iii 项 递推式:fi=1×fi−1+1×fi−2f_i = 1\times f_{i-1} + 1 \times f_{i-2}fi=1×fi−1+1×fi−...
C++
2022-10-27
1
316
题解 | #[SCOI2010]序列操作#
没有思路直接上代码 #include <iostream> #include <cstdio> #define lson u << 1 #define rson u << 1 | 1 using namespace std; const int ...
C++
2022-10-09
1
366
题解 | #回型矩阵#
x, y, d = 0, 0, 0 dx = [0, 1, 0, -1] dy = [1, 0, -1, 0] n = int(input()) a = [[0] * n for _ in range(n)]#必须要改变一下定义数组的方式 for i in range(1, n * n + 1)...
Python3
2022-09-28
1
355
题解 | #跳石板#
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10, INF = 0x3f3f3f3f; int n, m; int f[N];//f[i]表示跳到i号石板上所需的最小次数 int main()...
C++
2022-09-25
1
328
题解 | #Mr. Young's Picture Permutations#
Mr. Young's Picture Permutations #include <iostream> #include <cstring> using namespace std; const int N = 31; typedef long long LL; in...
C++
2022-09-22
0
431
题解 | #牛牛的最美味和最不美味的零食#
牛牛的最美味和最不美味的零食 #include <iostream> using namespace std; const int N = 1e6 + 10, INF = 0x3f3f3f3f; int n, m, a[N]; struct Node { int l, r; i...
C++
2022-08-24
1
341
首页
上一页
1
2
3
4
下一页
末页