Submission

Status:

PPPPPPPTPTPPPPPPPPPP

Subtask/Task Score:

90/100

Score: 90

User: cyblox_boi

Problemset: สุ่มสลับ

Language: cpp

Time: 0.195 second

Submitted On: 2025-12-27 21:52:48

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    string text;
    cin >> n >> text;

    string textToFind = text;
    int count = 0;

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

    do
    {
        count++;

        if (text == textToFind)
        {
            cout << count << '\n';
            break;
        }
    } while (next_permutation(text.begin(), text.end()));

    return 0;
}