超时了,45分
查看原帖
超时了,45分
1477508
JobsZheng楼主2024/11/27 21:28
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

vector <string> a;
string tmp;
string s;

int main() {
	cin >> tmp;
	int n = tmp.size();
	for (int i = 0; i < n; i++)
	{
		s = tmp.substr(i,n);
		a.push_back(s);
	}
	sort(a.begin(),a.end());
	for (int i = 0; i < n; i++)
	{
		cout << n - a[i].size() + 1 << " ";
	}
	return 0;
}
2024/11/27 21:28
加载中...