ICode9

精准搜索请尝试: 精确搜索
  • P4995 跳跳!2022-08-08 11:02:32

    https://www.luogu.com.cn/problem/P4995贪心,排序黄色题 思路:贪心策略:就是在剩余的石头中最大和最小来回跳。代码: #include<bits/stdc++.h> using namespace std; long long n,A[301],ans; int main(){ cin>>n; for(int i=1;i<=n;i++) cin>>A[i]; sort(A+1,A

  • P4995 跳跳!2022-04-08 13:03:40

    题目链接 https://www.luogu.com.cn/problem/P4995 。。。。。。。连着做了好几道一样的题啊。。。。为啥他就是黄题   放AC代码 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 int n; 6 long long int ans=0; 7 cin>>n; 8 i

  • P4995 跳跳!2022-01-29 12:00:19

    P4995 跳跳! 题目 题目大概的意思就是给出你n个石头高度 , 让你求消耗体力最大是多少 思路 ans += 最大的数 如果当前位置是最大的 就找最小的 代码 #include<bits/stdc++.h> using namespace std; #define int long long typedef long long ll; const int N = 1e6 + 10; int a

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有