Xiaoxina
Xiaoxina
全部文章
分类
题解(11)
归档
标签
去牛客网
登录
/
注册
Xiaoxina的博客
全部文章
(共11篇)
题解 | #Chocolate Eating# 这道题题解好少啊,写一篇吧
题意:贝西从bulls那里收到了N块巧克力。她不想把它们马上吃完,而是打算制定一个计划,使得在接下来的D天里,使得每天的最小快乐值最大。贝西的快乐指数可以用一个整数来衡量,一开始的时候是0,当她每天晚上睡觉的时候,快乐指数会减半(奇数时向下取整)。贝西把她的巧克力按照收到的时间排序,并坚持按照这个顺...
贪心
2021-04-18
3
802
题解 | #Raid# 最近点对
模板题,改一改就a了,注意输出格式 #include<iostream> #include<algorithm> #include<vector> #include<cmath> using namespace std; struct point{ ...
贪心
2021-04-10
0
716
NC16618排座椅
贪心,用了点没必要的差分,最后用sort排序输出就好 #include<iostream> #include<vector> #include<algorithm> using namespace std; bool cmp(vector<int>...
排序
贪心
暴力
2021-03-31
0
460
注意K的范围和结果用long long 存
思路和其他答主一模一样,我发这篇题解的目的就是提醒各位,要注意k的范围!!!!!!!!!!!!!!!!! #include<iostream> #include<vector> #include<algorithm> using namespace std; ...
排序
枚举
贪心
暴力
位运算
2021-03-29
0
620
NC204370:牛牛的木板 尺取法解析
来点不一样的,别人都是固定移动右端,依据情况移动左端我们来,固定移动左端,依据情况移动右端。处理一点点小细节。 int solve(int n, int m, vector<int>& a) { int r = 0, l = 0, cnt = 0, maxx = -1; ...
2021-03-24
1
664
枚举,位运算
思路和其他人一样,不过没有复杂的位运算,比较好懂卡了半天,发现忘记k++;woc #include<iostream> #include<string> #include<vector> #include<cmath> #include<algo...
2021-03-24
2
619
笨方法,没有什么递推公式,模拟人脑
#include<iostream> #include<vector> using namespace std; bool test(int temp,vector<int> a){ int n = a.size(),sum = temp,temp2;...
2021-03-22
1
644
摩尔投票法:参考【牛客458374228号】,做个记录
#include<iostream> using namespace std; int main(){ int n;cin>>n; int a,count = 0,res; cin>>a; res = a; n--; ...
2021-03-05
1
719
最少循环法,简短!!!
像素个数 = 长 * 宽所以:长 , 宽 为像素个数 n 的约数 约数是成对出现的 比如 8 = 1 * 8 , 8 = 2 * 4 分析可知 约数对的重复出现在 <= 一个数的平方根 #include<iostream> #include<cmath>...
2021-03-05
4
715
非矩阵解法//简短
不利用矩阵,采用计数的方法,来计算箱子的位置 #include<iostream> #include<cmath> using namespace std; int main(){ int cnt = 0;//计数器 int a; //开始计数 ...
2021-03-05
7
610
首页
上一页
1
2
下一页
末页