关于这道题的splay ~~它死了~~
by 弦巻こころ @ 2020-05-11 15:55:44
@[Eyjafjalla](/user/53852) 肯定不能通过了吗?感觉现在的机器比以前慢了,我拿别人的老代码测试好像也不行。。。
by damocris @ 2020-05-11 15:57:12
快读快输建议加上fread优化
```cpp
namespace IO_IN {
char buf[1<<26],*p1=buf,*p2=buf;
int getc() {
return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<26,stdin),p1==p2)?EOF:*p1++;
}
template <typename T> void IN(T&x) {
char ch;bool flag=0;x=0;
while(ch=getc(),!isdigit(ch)) if(ch=='-') flag=1;
while(isdigit(ch)) x=x*10+ch-48,ch=getc();
if(flag) x=-x;
}
}using namespace IO_IN;
namespace IO_OUT {
char buf[1<<26];
int p1=-1;
const int p2=(1<<26)-1;
void flush() {fwrite(buf,1,p1+1,stdout),p1=-1;}
void putc(const char &x) {if(p1==p2) flush();buf[++p1]=x;}
template <typename T> void print(T x) {
static char tmp[15];
static int len=-1;
if(x>=0) do {tmp[++len]=x%10+48,x/=10;} while(x);
else {putc('-');do {tmp[++len]=-(x%10)+48,x/=10;} while(x);}
while(len>=0) putc(tmp[len]),--len;
}
template <typename T> void print_(T&x) {print(x),flush(),putchar(' ');}
template <typename T> void _print(T&x) {print(x),flush(),putchar('\n');}
}using namespace IO_OUT;
```
by Qiuly @ 2020-05-11 15:57:31
@[damocris](/user/119884) 测评机日常,Ynoi的题目大部分还不是以毅力一次一次的提交而卡过去的(
by Qiuly @ 2020-05-11 15:58:18
@[Qiuly](/user/113190) splay是我最喜欢的数据结构,主要是比其他的省内存,不能用的话太可惜了。
by damocris @ 2020-05-11 16:03:06
@[damocris](/user/119884) 有些版本的splay好像可以...我写的那种怎么都过不去
by 弦巻こころ @ 2020-05-11 16:03:21
@[damocris](/user/119884) 这题我用fhq过得,这题只是因为m太大了把好多splay卡了.其实其他题该用照样用
by 弦巻こころ @ 2020-05-11 16:04:08
@[Eyjafjalla](/user/53852) 说不定可以用没有父结点的Splay尝试一下,但是到道理常数应该只会更大
by damocris @ 2020-05-11 16:05:42
4全是插入
我的treap也过不去,难受死了
by 老八小憨包 @ 2020-05-11 17:18:59
@[damocris](/user/119884) 您好,我用您的代码卡常过了
by Surelysuper @ 2020-05-11 17:29:26