Submission

Status:

P-P--------PP-P-----

Subtask/Task Score:

25/100

Score: 25

User: kavin8888

Problemset: สุ่มสลับ

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-22 08:49:10

#include<bits/stdc++.h>
using namespace std;
#define spps1 ios::sync_with_stdio(false)
#define spps2 cin.tie(nullptr)
int main()
{
	spps1; spps2;
	string n; cin>>n;
	string tmp="";
	for(int i=0;i<n.size();i++)
	{
		tmp+=n[i];
	}
	sort(tmp.begin(),tmp.end());
	int ans=0; int cnt=0;
	do
	{
		cnt++;
		if(tmp==n)
		{
			ans=cnt;
			break;
		}
		
	}while(next_permutation(tmp.begin(),tmp.end()));
	cout<<ans;
}