贪心骗样例
贪心骗样例
全部文章
分类
题解(3)
归档
标签
去牛客网
登录
/
注册
贪心骗样例的博客
全部文章
(共6篇)
题解 | #牛牛的背包#
#include<iostream> #include<algorithm> #include<cstring> using namespace std; struct commodity { int type; int taste; in...
2021-05-13
0
389
题解 | #牛牛的背包#
#include<iostream> #include<algorithm> #include<cstring> using namespace std; struct commodity { int type; int taste; in...
2021-05-13
0
399
题解 | #牛牛的背包#
#include<iostream> #include<algorithm> #include<cstring> using namespace std; struct commodity { int type; int taste; in...
2021-05-13
0
338
题解 | #移动石头#
因为移动石头的步骤顺序并不影响最后的总步数,所以我们可以只着眼于当前的石堆,当前石堆石头多了(正数)就把多余的石头给下一个石堆,少了就从下一个石堆拿(即使下一个石堆可能也是负数,那么就当先“欠账”就好)。 #include<iostream> #include<cmath> ...
2021-05-06
2
588
题解 | #两个机器人#
画出两机器人可能到达的位置区间(是个矩形),如果两矩形有重合部分则说明可能会爆炸。 #include<iostream> #include<cmath> using namespace std; int main() { int x1,y1,x2,y2; in...
2021-05-06
0
569
题解 | #牛牛的旅行#
include include include using namespace std;int main(){ int n,pos[301],delta[301]; long long int possession=0,debt=0,ans=0; cin>>n; ...
2021-05-02
0
521