芳华如梦v
芳华如梦v
全部文章
分类
基础算法2(10)
比赛(12)
归档
标签
去牛客网
登录
/
注册
芳华如梦v的博客
全部文章
(共22篇)
HPU算法协会公开课第二期: 【基础算法2】
A:https://blog.nowcoder.net/n/5e0e6e39300f4071ba38bb8324121c15 B:https://blog.nowcoder.net/n/0ed82669797f400a810a20facc02d6bb C:https://...
2020-05-24
0
375
J - Subsequence
尺取法(双指针) 使用前缀和减少求连续区间和的复杂度 #include <iostream> #include <string.h> #include <algorithm> #include <stdio....
2020-05-24
0
384
I - Can you solve this equation?
8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y 求这个方程在(0,100)的解 二分(0,100) 每次求出8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 的值 如果Y小于6或者大于x=100时Y的值直接 输出 ...
2020-05-24
0
399
H - Pie
N个Pie平均分给F+1个人 每个人分得的Pie只能是一块 采用二分 左界为最大的Pie/F+1 右界为最大的Pie 分得的Pie不可能在这个区间外边 如果分的份数少了 左界=mid 否则右界=mid 知道误差不超过0.001为止 不...
2020-05-24
0
436
F - 人见人爱A^B
A^B对1000取余即可 #include <iostream> #include <string.h> #include <algorithm> #include <stdio.h> #includ...
2020-05-24
0
469
E - Rightmost Digit
N^N对10取余即可 #include <iostream> #include <string.h> #include <algorithm> #include <stdio.h> #include&...
2020-05-24
0
478
D - Distribution money
求是否有某个人分的钱比其他人加起来还要多,看是否有ID的次数超过n/2+1即可 #include <iostream> #include <string.h> #include <algorithm> #include ...
2020-05-24
0
375
C - Key Set
求集合中和为偶数的非空子集的个数 2^(n-1)-1 #include <iostream> #include <string.h> #include <algorithm> #include <stdio...
2020-05-24
0
384
B - Raising Modulo Numbers
A的B次方求和再对M取余即可 数据较大 先取余再求和再取余结果也一样 #include <iostream> #include <string.h> #include <algorithm> #include &l...
2020-05-24
0
399
A - Pseudoprime numbers
判断p是否为素数且(a^p)%p是否等于a即可 #include <iostream> using namespace std; #define debug freopen("in.txt","r&quo...
2020-05-24
0
366
首页
上一页
1
2
3
下一页
末页