为什么MLE

P1046 [NOIP2005 普及组] 陶陶摘苹果

cinbingg @ 2019-11-10 18:37:54

#include<iostream>
#include<cstdio>
#include<map>
#include<vector>
#include<algorithm>
#include<stack>
#include<queue>
#define interesting int
#define dodo double
#define read(x){    \
    x=0;    \
    register char ch=getchar(); \
    int a=1;    \
    while(ch<'0'||ch>'9'){  \
        if(ch=='-') a=-1;   \
        ch=getchar();   \
    }   \
    while(ch>='0'&&ch<='9'){    \
        x=(x<<3)+(x<<1)+(ch^48);    \
        ch=getchar();   \
    }   \
    x=x*a;  \
}
using namespace std;
map<interesting,interesting>a;
queue<interesting> b;
vector<interesting>c;
stack<interesting>d;
queue<interesting> e;
void gb(interesting l,interesting r){
    if(l>r) return;
    interesting mid=(l+r)/2;
    gb(l,mid);
    gb(mid+1,r);
    interesting i=l,j=mid+1;
    while(i<=mid&&j<=r){
        if(c[i]>c[j]){
            e.push(c[j]);
            j++;
        }else{
            e.push(c[i]);
            i++;
        }
    }
    while(i<=mid) e.push(c[i]),i++;
    while(j<=r) e.push(c[j]),j++;
    for(interesting i=l;i<=r;i++){
        c[i]=e.front();
        e.pop();
    }
}
interesting main(){

    interesting k[15];
    interesting j,B,A;
    for(interesting i=1;i<=10;i++)
            scanf("%d",&k[i]);
    cin>>j;
    B=j+30;
    interesting wawa=0;
    for(interesting i=1;i<=10;i++)
    {
    if(k[i]<=B)  
    wawa++ ;
    }
    cout<<wawa;

    interesting n;
    for(interesting i=1;i<=10;i++){
        interesting xx;
        xx=a[i];
        b.push(xx);
        b.pop();
        d.push(xx);
        d.pop();
        c.push_back(xx);
        a[xx]++;
    }
    //scanf("%d",&n);
    n=n+(3<<3)+(1<<2)+(1<<1);
    sort(c.begin(),c.end());
    make_heap(c.begin(),c.end());
    sort_heap(c.begin(),c.end());
    gb(0,9);
    interesting ans=0;
    for(interesting i=0;i<=10;i++){
        if(c[i]<=n) ans++;
    }
    printf("%d\n",ans);
}

by 陈诺sb @ 2019-11-10 18:39:59

你太秀了 所以 MLE 了


by USS_Enterprise @ 2019-11-10 18:47:21

不错不错,终于有人用Markdown


by 冥诺在线发呆 @ 2019-11-10 18:49:16

interesting


by LCGUO @ 2019-11-10 18:59:36

您是我见过最秀的人,没有之一


by hjxhjx @ 2019-11-10 19:03:43

同意楼上


by Sya_Resory @ 2019-11-10 19:05:55

因缺斯汀


by aaaa1234 @ 2019-11-14 22:42:20

同感


by Day_Dreamer @ 2019-11-17 09:48:09

int interesting 秀


by 威威多多 @ 2020-01-16 17:26:36

您太秀了


by cannotdp @ 2020-01-19 10:50:57

 Why you MLE?
 beacause you are vary vary 秀

|