Submission #3820845


Source Code Expand

s = input()
t = input()
d1 = {}
d2 = {}

for i in range(len(s)):
  if s[i] not in d1:
    d1[s[i]] = t[i]
  elif d1[s[i]] != t[i]:
    print("No")
    break
  if t[i] not in d2:
    d2[t[i]] = s[i]
  elif d2[t[i]] != s[i]:
    print("No")
    break
  
else:
  print("Yes")

Submission Info

Submission Time
Task C - String Transformation
User firkirb
Language Python (3.4.3)
Score 300
Code Size 290 Byte
Status AC
Exec Time 130 ms
Memory 3632 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 24
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All 0_min0, 0_min1, 1_small0, 1_small1, 1_small2, 2_medium0, 2_medium1, 2_medium2, 2_medium3, 2_medium4, 3_max0, 3_max1, 3_max2, 3_max3, 3_max4, 3_max5, 3_max6, 3_max7, 3_max8, 3_max9, 5_hand0, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_min0 AC 18 ms 3060 KB
0_min1 AC 18 ms 3060 KB
1_small0 AC 18 ms 3064 KB
1_small1 AC 18 ms 3064 KB
1_small2 AC 18 ms 3064 KB
2_medium0 AC 19 ms 3444 KB
2_medium1 AC 93 ms 3564 KB
2_medium2 AC 38 ms 3064 KB
2_medium3 AC 96 ms 3520 KB
2_medium4 AC 33 ms 3444 KB
3_max0 AC 19 ms 3632 KB
3_max1 AC 130 ms 3632 KB
3_max2 AC 18 ms 3632 KB
3_max3 AC 83 ms 3632 KB
3_max4 AC 30 ms 3632 KB
3_max5 AC 19 ms 3632 KB
3_max6 AC 126 ms 3632 KB
3_max7 AC 81 ms 3632 KB
3_max8 AC 79 ms 3632 KB
3_max9 AC 128 ms 3632 KB
5_hand0 AC 18 ms 3064 KB
sample_01 AC 18 ms 3064 KB
sample_02 AC 18 ms 3064 KB
sample_03 AC 18 ms 3064 KB