快轉到主要內容

CSES-1622 Creating Strings

目錄

題目連結:https://cses.fi/problemset/task/1622

題意
#

(待補)

思路
#

(待補)

程式碼
#

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    string input;
    vector<string> v;
    int count = 0;
    cin >> input;

    sort(input.begin(), input.end());

    do{
        v.push_back(input);
        count++;
    } while(next_permutation(input.begin(), input.end()));

    cout << count << '\n';
    for(string s : v)
        cout << s << '\n';
}
Piau 的筆記本
作者
Piau 的筆記本
希望我寫下來的東西能夠長久的記在我的腦中