Submission

Status:

PPPPPPPTPTPPPPPPPPPP

Subtask/Task Score:

90/100

Score: 90

User: Cmoss9

Problemset: สุ่มสลับ

Language: cpp

Time: 0.197 second

Submitted On: 2025-06-11 21:49:53

#include <bits/stdc++.h>
using namespace std;
int main () {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    string s;
    cin >> n >> s;
    string t = s;
    sort(s.begin(), s.end());
    int res = 0;
    do {
        res++;
        if (s == t) break;
    } while (next_permutation(s.begin(), s.end()));
    cout << res;
}