这篇的优化并没有什么用,因为我只要让询问不是Yes,并且使前面一段未合并的区间颜色都相同,只有最后一个位置不同,这篇题解就寄了。
mkdata:
#include<bits/stdc++.h>
using namespace std;
int n,m;
signed main()
{
freopen("data.in","w",stdout);
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
n=500000;m=500000;
cout<<n<<'\n';
for(int i=1;i<n;i++)cout<<'A';cout<<'B'<<'\n';
cout<<m<<'\n';
for(int l=2,r=n-2;l<=r;l++,r--)
{cout<<'A'<<' '<<l<<' '<<r<<' '<<'A'<<'\n';m--;}
while(m--)
{cout<<'B'<<' '<<1<<' '<<n<<'\n';}
}
请求管理加强数据