如果你加了 ios::sync_with_stdio(0); 仍然会 TLE on #11、12,那么请再加上 cin.tie(0), cout.tie(0);。
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);