TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Input Format

Output Format

Sample Input 1

II
ID
DI
DD
?D
??

Sample Output 1

1
2
2
1
3
6

Hints

Permutation {1,2,3} has signature "II".

Permutations {1,3,2} and {2,3,1} have signature "ID".

Permutations {3,1,2} and {2,1,3} have signature "DI".

Permutation {3,2,1} has signature "DD".

"?D" can be either "ID" or "DD".

"??" gives all possible permutations of length 3.

Problem Source

Migrated from old NTUJ.

ACM ICPC Dalian 2011

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 200