玄学问题求解答
查看原帖
玄学问题求解答
879904
WorldMachine楼主2023/12/26 17:11

为什么这样写( add 和 del )不行

#define add(x) tmp += (!cnt[x] ? 1 : 0), cnt[x]++
#define del(x) cnt[x]--, tmp -= (!cnt[x] ? 1 : 0)

得改成

inline void add(int x) { tmp += (!cnt[x] ? 1 : 0), cnt[x]++; }
inline void del(int x) { cnt[x]--, tmp -= (!cnt[x] ? 1 : 0); }
2023/12/26 17:11
加载中...