D - Pentagon 解説 by evima
Another Solution?An edge is short if it is contained in ABCDEAEDCBA
as a substring, and long otherwise.
Sample Implementation (Python)
P = "ABCDEAEDCBA"
S = input()
T = input()
print("Yes" if (S in P) == (T in P) else "No")
投稿日時:
最終更新: