线段树数组不要开太大。
输入操作的时候不要用 getchar,用 scanf("%s",opt); 或 scanf(" %c",&opt);
getchar
scanf("%s",opt);
scanf(" %c",&opt);