RT,在查询的时候,我定义了一个桶:
int cnt[maxn];//maxn 是元素的个数
然后每次查询的时候是这样清空数组的:
memset(cnt,0,sizeof(cnt));
这样的时间复杂度是 O(nm)O(nm)O(nm) 吗?但是它过了。