Submission #48569146
Source Code Expand
S=input()
T=input()
if S[0]=="A":
S0=0
if S[0]=="B":
S0=1
if S[0]=="C":
S0=2
if S[0]=="D":
S0=3
if S[0]=="E":
S0=4
if S[1]=="A":
S1=0
if S[1]=="B":
S1=1
if S[1]=="C":
S1=2
if S[1]=="D":
S1=3
if S[1]=="E":
S1=4
if T[0]=="A":
T0=0
if T[0]=="B":
T0=1
if T[0]=="C":
T0=2
if T[0]=="D":
T0=3
if T[0]=="E":
T0=4
if T[1]=="A":
T1=0
if T[1]=="B":
T1=1
if T[1]=="C":
T1=2
if T[1]=="D":
T1=3
if T[1]=="E":
T1=4
S=abs(S0-S1)
T=abs(T0-T1)
if (S==2 or S==3)and(T==2 or T==3):
print("Yes")
elif(S==1 or S==4)and(T==1 or T==4):
print("Yes")
elif(S==T):
print("Yes")
else:
print("No")
Submission Info
| Submission Time | |
|---|---|
| Task | B - Pentagon |
| User | nyrhtktk |
| Language | Python (CPython 3.11.4) |
| Score | 200 |
| Code Size | 666 Byte |
| Status | AC |
| Exec Time | 10 ms |
| Memory | 8900 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 9 ms | 8864 KiB |
| 00_sample_02.txt | AC | 9 ms | 8896 KiB |
| 00_sample_03.txt | AC | 10 ms | 8804 KiB |
| 01_test_01.txt | AC | 9 ms | 8852 KiB |
| 01_test_02.txt | AC | 9 ms | 8788 KiB |
| 01_test_03.txt | AC | 9 ms | 8800 KiB |
| 01_test_04.txt | AC | 9 ms | 8896 KiB |
| 01_test_05.txt | AC | 10 ms | 8808 KiB |
| 01_test_06.txt | AC | 10 ms | 8860 KiB |
| 01_test_07.txt | AC | 9 ms | 8764 KiB |
| 01_test_08.txt | AC | 9 ms | 8816 KiB |
| 01_test_09.txt | AC | 9 ms | 8856 KiB |
| 01_test_10.txt | AC | 9 ms | 8864 KiB |
| 01_test_11.txt | AC | 10 ms | 8820 KiB |
| 01_test_12.txt | AC | 9 ms | 8880 KiB |
| 01_test_13.txt | AC | 9 ms | 8852 KiB |
| 01_test_14.txt | AC | 9 ms | 8900 KiB |
| 01_test_15.txt | AC | 9 ms | 8740 KiB |