for(pair<int,int> x:mp)
这种写法着实有点抽象,自己写的很麻烦看了题解这么写豁然开朗,然后本地过不了编译,显示
[Error] range-based 'for' loops are not allowed in C++98 mode
他就很抽象,要不是洛谷IDE能跑还以为写炸了。