백준 c++ 11656 접미사 배열

jaranda·2022년 2월 18일
0

11656 접미사 배열

문제풀이

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
void fast_io(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
int main(void)
{
    fast_io();
    string str;
    cin >> str;
    vector<string> v;
    for (int i = 0; i < str.size();i++)
    {
        v.push_back(str.substr(i, str.size()));
    }
    sort(v.begin(), v.end());
    for (auto i : v)
    {
        cout << i << "\n";
    }
}

끊어서 넣은뒤 정렬하고 출력했다.

profile
자라는 개발자

0개의 댓글

관련 채용 정보