先bfs预处理出1号点通过三种操作不经过[-1e7,1e7]以外的点能到达的所有点的集合S,并记录集合内每个点的pre 每次询问先处理x直到x∈S,再不断找pre直到x=1 处理方法:如果x%2==0,x/=2,否则x=3*x+1; #include<cstdio> using namespace std; typedef long long LL; const int N=1e7; int pr[N*2+5],Q[N*2+5],h,t,q,d,l; LL out[1505]; bool vs[N*2+5]; inline LL Z(LL x) {return x<0?-x:...