关个流同步就行了。 关流同步:https://www.luogu.com.cn/record/192654338 不关流:https://www.luogu.com.cn/record/192654426 关流同步代码:
#include<iostream> //something; using namespace std; //something; int main(){ //以下为关流同步代码 ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); //something; return 0; }