Eunki's DNA Molecules
Time limit5sMemory limit256 MB
For every pair of N DNA strings, decide whether four two-way substring swaps can rewrite one into the other.
Problem
A DNA string uses A, C, G, T. Apply these bidirectional substring replacements:
- A ↔ TC
- C ↔ AG
- G ↔ CT
- T ↔ GA
For strings, output whether each pair can transform from the first to the second.
Input
Line 1: (). Next DNA strings (length ).
Output
lines of 0/1 chars; 1 at means string can become string .