迟了一点,CF上uphacking的一周结束了,发在这里:
unordered和gp_hash_table#include<stdio.h>
#include<set>
#define int long long
#define N 972777519512027136ll
using namespace std;
set<int>s,t,q;
main()
{
q.emplace(N);
for(int i;s.size()+t.size()<150000;)
{
i=*--q.end();q.erase(--q.end());
for(;q.size()>150000;q.erase(q.begin()));
t.emplace(i);
for(int j=i;j<=N&&s.size()+t.size()<150000;j+=i)
s.emplace(j);
if(!(i&1))q.emplace(i/2);
if(!(i%3))q.emplace(i/3);
}
printf("200000\n");
for(set<int>::iterator it=s.begin();it!=s.end();++it)
printf("+ %lld\n",*it);
for(set<int>::iterator it=t.begin();it!=t.end();++it)
printf("? %lld\n",*it);
for(int i=25000;i--;)printf("- %lld\n+ %lld\n",N,N);
}