首先,你需要关闭输入输出同步流:
ios::sync_with_stdio(false); cin.tie(nullptr), cout.tie(nullptr);
但是如果还T的话,把false和nullptr全改成0:
ios::sync_with_stdio(0); cin.tie(0), cout.tie(0);
还T那就是你写挂了