此题不能使用常规的 cin/cout,会超时。必须关闭流同步(代码见下)或使用 scanf/printf。
cin
cout
scanf
printf
TLE:https://www.luogu.com.cn/record/90079246 AC:https://www.luogu.com.cn/record/167401047
两年了还没变马蜂
关闭流同步代码。
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);