A 签到题。2^n就是1<<n,正常比大小就可以了。 int n; cin >> n; if ((1 << n) > n * n * n)cout << "B" << endl; else cout << "A" << endl; B 不重不漏枚举起点,长度一定所以终点一定,对于每个这样的字串判断是否符合条件。 #include<iostream> using namespace std; int main(){ string s; cin...