Submit solution
Points:
0.09 (partial)
Time limit:
1.0s
Memory limit:
512M
Input:
stdin
Output:
stdout
Problem source:
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch
Cho một xâu ~S~ chỉ gồm các chữ cái in hoa, ~1 \le~ độ dài ~\le 9~. Yêu cầu:
- Có bao nhiêu cách hoán vị các chữ cái của xâu ~S~
- Liệt kê các hoán vị đó theo thứ tự từ điển
Input
Gồm ~1~ dòng duy nhất chứa xâu ~S~
Output
- Dòng ~1~: Ghi số lượng hoán vị tìm được ~(K)~
- ~K~ dòng tiếp theo, mỗi dòng ghi một xâu hoán vị của xâu ~S~ theo đúng thứ tự từ điển
Sample Input
ABAB
Sample Output
6
AABB
ABAB
ABBA
BAAB
BABA
BBAA
Comments
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.