摘要:
相邻石子合并问题 代码 #include<bits/stdc++.h> using namespace std; #define rep(i,a,n) for(int i = a; i <= n; i++) const int N = 330; int sum[N]; int a[N]; int f 阅读全文
摘要:
原题链接 代码 #include<iostream> #include<algorithm> using namespace std; const int N = 100010; const int mod = 1000000007; int a[N],b[N]; //总结: 记得开 long lo 阅读全文
摘要:
原题链接 解题思路 通过i和j来控制子矩阵的左右边界,通过s和t来控制子矩阵的上下边界, 在子矩阵的和小于k时候,统计子矩阵的个数。 代码 #include<iostream> using namespace std; const int N = 550; int a[N][N]; // i 与 j 阅读全文
摘要:
原题链接 代码 #include<iostream> using namespace std; const int N = 100010; int a[N],f[N]; int main(){ int n; cin >> n; int ans = 0, j = 1; for(int i = 1; i 阅读全文