TopCoder

User's AC Ratio

100.0% (1/1)

Submission's AC Ratio

66.7% (2/3)

Tags

Description

please see pdf file linked from contest page.
Warn: 本題有 specialjudge

Input Format

Output Format

Sample Input 1

2
P Q
R S
6
P Q
Q R
R S
S T
T U
U P
4
P Q
P Q
P Q
P Q
3
P Q
Q R
R P
6
P Q
Q S
S R
R P
P S
R Q

Sample Output 1

0
P Q
R S
0
P Q
R Q
R S
T S
T U
P U
0
P Q
P Q
P Q
P Q
1
P Q
Q R
P R
2
P Q
Q S
R S
P R
P S
R Q

Hints

Problem Source

Migrated from old NTUJ.

NEERC 2009

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 10000 65536 4096