第十个点超时,求玄学剪枝方法

P1171 售货员的难题

~~开O2~~
by 暮天闻角 @ 2018-05-09 15:10:21


@[暮天闻角](/space/show?uid=59636) 开O2还是过不了...尴尬QWQ
by 瓜皮少年 @ 2018-05-09 15:16:18


~~试试快读吧~~ ```cpp inline char get(){ static char buf[maxn],*p1=buf,*p2=buf; return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++; } template<class A>inline void read(A &_){ _=0;char c=get();bool f=false; while(c>'9' || c<'0'){if(c=='-')f=true;c=get();} while(c>='0' && c<='9'){_=(_<<3)+(_<<1)+c-'0';c=get();}if(f)_=-_; } ```
by 暮天闻角 @ 2018-05-09 15:25:11


@[暮天闻角](/space/show?uid=59636) 一样,QWQ..可能要玄学剪枝
by 瓜皮少年 @ 2018-05-09 15:47:17


$register$ $int$,$inline$ 以及一系列玄学 ```cpp #pragma GCC target("f16c") #pragma GCC optimize("Ofast") #pragma GCC target("sse3","sse2","sse") #pragma GCC diagnostic error "-std=c++14" #pragma GCC diagnostic error "-fwhole-program" #pragma GCC diagnostic error "-fcse-skip-blocks" #pragma comment(linker, "/STACK:102400000,102400000") #pragma GCC diagnostic error "-funsafe-loop-optimizations" #pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3") #pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector") ```
by 暮天闻角 @ 2018-05-09 15:53:34


~~话说这不是普通快读,此处有fread~~ ```cpp #define ll long long inline char get(){ static char buf[30],*p1=buf,*p2=buf; return p1==p2&&(p2=(p1=buf)+fread(buf,1,30,stdin),p1==p2)?EOF:*p1++; } inline ll read(){ register char c=get();register ll f=1,_=0; while(c>'9' || c<'0')f=(c=='-')?-1:1,c=get(); while(c>='0' && c<='9')_=(_<<3)+(_<<1)+(c^48),c=get();return _*f; } ```
by 暮天闻角 @ 2018-05-09 16:07:51


等一下,,,这是道~~状压~~啊,,,~~您的爆搜理论上卡不过~~
by 暮天闻角 @ 2018-05-09 16:26:36


~~刚刚玄学骗数据A了~~,不过rank2,似乎爆搜了
by 暮天闻角 @ 2018-05-09 16:53:26


@[暮天闻角](/space/show?uid=59636) 嗯哼...怎么A了,喵喵喵,QWQ
by 瓜皮少年 @ 2018-05-12 13:09:37


@[瓜皮少年](/space/show?uid=52530) ~~当然是打表啦~~
by 暮天闻角 @ 2018-05-12 18:10:09


|