QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#418579#4918. 染色dengtingyuCompile Error//C++145.8kb2024-05-23 14:36:302024-05-23 14:36:32

Judging History

你现在查看的是最新测评结果

  • [2024-05-23 14:36:32]
  • 评测
  • [2024-05-23 14:36:30]
  • 提交

answer

#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#include<bits/stdc++.h>
using namespace std;
#define ll int
#define ull unsigned long long
#define T pair<ll,ll>
#define fi first
#define se second
#define mk make_pair
const ll N=3e5+10,inf=1e9+10;
ll n,m;
ull val[N<<2],tag[N<<2],tgmi[N<<2];
ll len[N<<2];
T mi[N<<2];
struct sd{
    priority_queue<ll,vector<ll>,greater<ll> >u,v;
    inline void push(ll x){u.push(x);return ;}
    inline void pop(ll x){v.push(x);return ;}
    inline ll gt(){while(!v.empty()&&u.top()==v.top())u.pop(),v.pop();if(u.empty())return inf;return u.top();}
}hs[N<<2];
inline void push(ll o,ull x){tag[o]+=x;val[o]+=x*len[o];return ;}
inline void pushm(ll o,ull x,ll y){if(y>=hs[o].gt())push(o,x);else if(y>=mi[o].fi)tgmi[o]+=x,val[o]+=x*mi[o].se;return ;}
inline void pushdown(ll o){
    if(tag[o])push(o<<1,tag[o]),push(o<<1|1,tag[o]),tag[o]=0;
    if(tgmi[o])pushm(o<<1,tgmi[o],mi[o].fi),pushm(o<<1|1,tgmi[o],mi[o].fi),tgmi[o]=0;
    return ;
}
inline T heb(T x,T y){if(x.fi==y.fi)return mk(x.fi,x.se+y.se);return min(x,y);}
inline void pushup(ll o){
    mi[o]=heb(mi[o<<1],mi[o<<1|1]);
    if(mi[o].fi>=hs[o].gt())mi[o]=mk(hs[o].gt(),len[o]);
    val[o]=val[o<<1]+val[o<<1|1];
    return ;
}
inline void build(ll o,ll l,ll r){
    len[o]=r-l+1;if(l==r){mi[o]=mk(inf,1);return ;}
    ll mid=(l+r)>>1;
    build(o<<1,l,mid);
    build(o<<1|1,mid+1,r);
    pushup(o);return ;
}
inline void update(ll o,ll l,ll r,ll x,ll y,ll z,ll tp){
    if(l==r){if(tp)hs[o].push(z);else hs[o].pop(z);mi[o]=mk(hs[o].gt(),1);return ;}
    if(x<=l&&r<=y){
        pushdown(o);
        if(tp)hs[o].push(z);else hs[o].pop(z);
        pushup(o);
        return ;
    }ll mid=(l+r)>>1;pushdown(o);
    if(mid>=x)update(o<<1,l,mid,x,y,z,tp);
    if(mid<y)update(o<<1|1,mid+1,r,x,y,z,tp);
    pushup(o);return ;
}
inline void add(ll o,ll l,ll r,ll x,ll y,ull z){
    if(x<=l&&r<=y){push(o,z);return ;}
    ll mid=(l+r)>>1;pushdown(o);
    if(mid>=x)add(o<<1,l,mid,x,y,z);
    if(mid<y)add(o<<1|1,mid+1,r,x,y,z);
    pushup(o);return ;
}
inline void upd(ll o,ll l,ll r,ll x,ll y,ll p,ull z){
    if(hs[o].gt()<=p){add(o,l,r,x,y,z);return ;}
    if(x<=l&&r<=y){pushm(o,z,p);return ;}
    ll mid=(l+r)>>1;pushdown(o);
    if(mid>=x)upd(o<<1,l,mid,x,y,p,z);
    if(mid<y)upd(o<<1|1,mid+1,r,x,y,p,z);
    pushup(o);return ;
}
inline ull ask(ll o,ll l,ll r,ll x,ll y){
    if(x<=l&&r<=y)return val[o];
    ll mid=(l+r)>>1;ull an=0;pushdown(o);
    if(mid>=x)an+=ask(o<<1,l,mid,x,y);
    if(mid<y)an+=ask(o<<1|1,mid+1,r,x,y);
    return an;
}
inline ll query(ll o,ll l,ll r,ll x,ll y){
    if(x<=l&&r<=y)return mi[o].fi;
    ll mid=(l+r)>>1,an=hs[o].gt();pushdown(o);
    if(mid>=x)an=min(an,query(o<<1,l,mid,x,y));
    if(mid<y)an=min(an,query(o<<1|1,mid+1,r,x,y));
    return an;
}
set< T >s[N];
inline void ins(ll o,ll l,ll r){s[o].insert(mk(l,r));update(1,1,n,l,r,o,1);return ;}
inline void era(ll o,ll l,ll r){s[o].erase(mk(l,r));update(1,1,n,l,r,o,0);return ;}
inline void split(ll o,ll x){
    auto p=s[o].lower_bound(mk(x,inf));if(p==s[o].begin())return ;
    p--;if((*p).se<x||(*p).fi==x)return ;
    ll u=(*p).fi,v=(*p).se;
    era(o,u,v);
    ins(o,u,x-1);ins(o,x,v);
    return ;
}
inline void out(ll o,ll l,ll r){
    split(o,l);split(o,r+1);
    for(auto p=s[o].lower_bound(mk(l,0));p!=s[o].end()&&(*p).fi<=r;){
        ll u=(*p).fi,v=(*p).se;p++;
        era(o,u,v);
    }return ;
}
int main(){
    freopen("test1.in","r",stdin);
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>n>>m;build(1,1,n);
    for(int i=1;i<=m+1;i++)ins(i,1,n);
    for(int i=1;i<=m;i++){
        ll op,l,r;ull x;cin>>op>>l>>r;if(op!=4)cin>>x;
        if(op==1){
            out(x,l,r);   
        }if(op==2){
            out(x,l,r);ins(x,l,r);
        }if(op==3){
            ll tem=query(1,1,n,l,r);
            upd(1,1,n,l,r,tem,x);
        }if(op==4)cout<<ask(1,1,n,l,r)<<'\n';
    }return 0;
}

详细

answer.code:22:39: warning: bad option ‘-fwhole-program’ to pragma ‘optimize’ [-Wpragmas]
   22 | #pragma GCC optimize("-fwhole-program")
      |                                       ^
answer.code:29:41: warning: bad option ‘-fstrict-overflow’ to pragma ‘optimize’ [-Wpragmas]
   29 | #pragma GCC optimize("-fstrict-overflow")
      |                                         ^
answer.code:31:41: warning: bad option ‘-fcse-skip-blocks’ to pragma ‘optimize’ [-Wpragmas]
   31 | #pragma GCC optimize("-fcse-skip-blocks")
      |                                         ^
answer.code:45:51: warning: bad option ‘-funsafe-loop-optimizations’ to pragma ‘optimize’ [-Wpragmas]
   45 | #pragma GCC optimize("-funsafe-loop-optimizations")
      |                                                   ^
answer.code:63:26: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   63 |     inline void push(ll x){u.push(x);return ;}
      |                          ^
answer.code:63:26: warning: bad option ‘-fstrict-overflow’ to attribute ‘optimize’ [-Wattributes]
answer.code:63:26: warning: bad option ‘-fcse-skip-blocks’ to attribute ‘optimize’ [-Wattributes]
answer.code:63:26: warning: bad option ‘-funsafe-loop-optimizations’ to attribute ‘optimize’ [-Wattributes]
answer.code:64:25: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   64 |     inline void pop(ll x){v.push(x);return ;}
      |                         ^
answer.code:64:25: warning: bad option ‘-fstrict-overflow’ to attribute ‘optimize’ [-Wattributes]
answer.code:64:25: warning: bad option ‘-fcse-skip-blocks’ to attribute ‘optimize’ [-Wattributes]
answer.code:64:25: warning: bad option ‘-funsafe-loop-optimizations’ to attribute ‘optimize’ [-Wattributes]
answer.code:65:18: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   65 |     inline ll gt(){while(!v.empty()&&u.top()==v.top())u.pop(),v.pop();if(u.empty())return inf;return u.top();}
      |                  ^
answer.code:65:18: warning: bad option ‘-fstrict-overflow’ to attribute ‘optimize’ [-Wattributes]
answer.code:65:18: warning: bad option ‘-fcse-skip-blocks’ to attribute ‘optimize’ [-Wattributes]
answer.code:65:18: warning: bad option ‘-funsafe-loop-optimizations’ to attribute ‘optimize’ [-Wattributes]
answer.code:67:28: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   67 | inline void push(ll o,ull x){tag[o]+=x;val[o]+=x*len[o];return ;}
      |                            ^
answer.code:67:28: warning: bad option ‘-fstrict-overflow’ to attribute ‘optimize’ [-Wattributes]
answer.code:67:28: warning: bad option ‘-fcse-skip-blocks’ to attribute ‘optimize’ [-Wattributes]
answer.code:67:28: warning: bad option ‘-funsafe-loop-optimizations’ to attribute ‘optimize’ [-Wattributes]
answer.code:68:34: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   68 | inline void pushm(ll o,ull x,ll y){if(y>=hs[o].gt())push(o,x);else if(y>=mi[o].fi)tgmi[o]+=x,val[o]+=x*mi[o].se;return ;}
      |                                  ^
answer.code:68:34: warning: bad option ‘-fstrict-overflow’ to attribute ‘optimize’ [-Wattributes]
answer.code:68:34: warning: bad option ‘-fcse-skip-blocks’ to attribute ‘optimize’ [-Wattributes]
answer.code:68:34: warning: bad option ‘-funsafe-loop-optimizations’ to attribute ‘optimize’ [-Wattributes]
answer.code:69:26: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   69 | inline void pushdown(ll o){
      |                          ^
answer.code:69:26: warning: bad option ‘-fstrict-overflow’ to attribute ‘optimize’ [-Wattributes]
answer.code:69:26: warning: bad option ‘-fcse-skip-blocks’ to attribute ‘optimize’ [-Wattributes]
answer.code:69:26: warning: bad option ‘-funsafe-loop-optimizations’ to attribute ‘optimize’ [-Wattributes]
answer.code:74:21: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   74 | inline T heb(T x,T y){if(x.fi==y.fi)return mk(x.fi,x.se+y.se);return min(x,y);}
      |                     ^
answer.code:74:21: warning: bad option ‘-fstrict-overflow’ to attribute ‘optimize’ [-Wattributes]
answer.code:74:21: warning: bad option ‘-fcse-skip-blocks’ to attribute ‘optimize’ [-Wattributes]
answer.code:74:21: warning: bad option ‘-funsafe-loop-optimizations’ to attribute ‘optimize’ [-Wattributes]
answer.code:75:24: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   75 | inline void pushup(ll o){
      |                        ^
answer.code:75:24: warning: bad option ‘-fstrict-overflow’ to attribute ‘optimize’ [-Wattributes]
answer.code:75:24: warning: bad option ‘-fcse-skip-blocks’ to attribute ‘optimize’ [-Wattributes]
answer.code:75:24: warning: bad option ‘-funsafe-loop-optimizations’ to attribute ‘optimize’ [-Wattributes]
answer.code:81:33: warning: bad option ‘-fwhole-program’ to attribute ‘optimize’ [-Wattributes]
   81 | inline void build(ll o,ll l,ll r){
     ...