分析 暴搜每一个位置,开头从1开始,每次记录和,再取最后一位暴搜。 上代码 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n,k;