上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 54 下一页
  2023年4月9日
摘要: https://www.luogu.com.cn/problem/UVA12230 期望的线性性质 设初始答案 A,为全走陆地的时间 D,则每次输入时去河的长度 L,加上渡河期望时间 2* L/v #include<iostream> #include<cstring> #include<algor 阅读全文
posted @ 2023-04-09 15:58 towboat 阅读(15) 评论(0) 推荐(0)
摘要: 有高度分别为1到n的n根杆子排成一行。如果你从左侧或右侧看这些杆,较小的杆被较高的杆遮挡。 给出杆子的数量n,从左能看到的杆子数量L,从右能看到的杆子数量R,求杆子有多少种排列方式 考虑高度1~n的柱子, 把高度1的插入 2~i 的某个排列中转移 f[i ][j] [k ]=f[i-1][j-1][ 阅读全文
posted @ 2023-04-09 15:36 towboat 阅读(15) 评论(0) 推荐(0)
摘要: 两人赛马,最终名次有3种可能 求n人赛马时最终名次的可能性的个数 #include<iostream> #include<cstring> #include<algorithm> #include<set> using namespace std; #define mod 10056 int c[1 阅读全文
posted @ 2023-04-09 12:45 towboat 阅读(11) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstring> #include<algorithm> #include<set> using namespace std; int f[44],n; signed main() { int i; f[3]=1,f[4]=3; for(i=5 阅读全文
posted @ 2023-04-09 12:06 towboat 阅读(16) 评论(0) 推荐(0)
  2023年4月7日
摘要: 记忆化搜索 #include <iostream> #include <cstring> #include <iomanip> using namespace std; double f[5][5][5][5][5][5][5][5][5]; bool v[5][5][5][5][5][5][5][ 阅读全文
posted @ 2023-04-07 17:06 towboat 阅读(23) 评论(0) 推荐(0)
摘要: #include<iostream> #include<vector> #include<cstring> #include<algorithm> using namespace std; const int N=104; string s; void sov(){ int i; int len=s 阅读全文
posted @ 2023-04-07 15:24 towboat 阅读(6) 评论(0) 推荐(0)
摘要: 给定一个数字n,如样例所示格式输出满足1<=b<=a<=n且gcd(a,b)==a xor b的(a,b)二元组个数 #include<iostream> #include<vector> #include<cmath> #include<algorithm> using namespace std 阅读全文
posted @ 2023-04-07 02:42 towboat 阅读(16) 评论(0) 推荐(0)
  2023年4月6日
摘要: 求C(i,j)/ C(u,v) 公式化简 筛出所有质数 除法的时候: 因数分解, 求对每个质数的个数的贡献 #include <iostream> #include <cstring> #include <cmath> #include <iomanip> #include <vector> usi 阅读全文
posted @ 2023-04-06 21:17 towboat 阅读(14) 评论(0) 推荐(0)
  2023年4月5日
摘要: 树状数组 1. 求区间和 2. 单点赋值 还是单点改,通过维护一个a[ i ],来求改变值 #include <iostream> #include <cstring> #include <sstream> using namespace std; const int N=2e5+4; int n, 阅读全文
posted @ 2023-04-05 23:15 towboat 阅读(24) 评论(0) 推荐(0)
摘要: 求一个最短序列,使得输入的两个串的均为他的子序列,同时输出方案数。 n+m-LCS 方案数转移时求 #include <iostream> #include <cstring> using namespace std; #define int long long int n,m; char a[10 阅读全文
posted @ 2023-04-05 22:46 towboat 阅读(13) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 54 下一页