这个好坑 用 to_string最后一个测试点会超时
#include <iostream>
using namespace std;
int main() {
string s;
int n, j;
cin >> s >> n;
for (int cnt = 1; cnt < n; cnt++) {
string t;
for (int i = 0; i < s.length(); i = j) {
for (j = i; j < s.length() && s[j] == s[i]; j++);
t.push_back(s[i]);
t.push_back(j - i + '0');
}
s = t;
}
cout << s;
return 0;
}