5.15 每日一题 在你窗外闪耀的星星

5.15 每日一题 在你窗外闪耀的星星_第1张图片

 这题做法应该挺多的,一个比较简单的直接思路就是双指针跑一下吧?

反正我是双指针跑一下就wa了

wa哪里了呢,满怀期待的我下载了第一个样例~~

好吧w可以等于0 

特判一下-------->Ac啦~~~

#include
#include
#include
#include
#include
#include
#define ll long long


#define inf 0x3f3f3f3f

using namespace std;

const int maxn=100005;
struct node {
    int x,b;
    bool operator<(const node &a){
        return x>n>>w;
    for(i=0;i>mo[i].x>>mo[i].b;
    }
    if(w==0){
        cout<<0<j) j=i;
        if(i==j) {
            sum=mo[i].b;
            ans=max(ans,sum);
        }
        while(j+1

你可能感兴趣的:(蓝桥杯,c++,算法)