이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
def provjera(L1,L2):
A,B=[],[]
for i in range(len(L1)):
if L1[i]!=L2[i]:
A.append(L1[i])
B.append(L2[i])
return A,B
def main():
N=int(input())
L=input().split()
L2=input().split()
#print('L:',L,'L2:',L2)
L,L2=provjera(L,L2)
#print('NAKON L:',L,'L2:',L2)
while L!=[]:
for i in range(len(L)):
if L[i].isdigit() and L2[i].isdigit():
print("NE")
return
elif (L[i].isdigit() is not True) and L2[i].isdigit():
for j in range(len(L)):
if L[j]==L[i]: L[j]=L2[i]
if L2[j]==L[i]: L2[j]=L2[i]
elif (L2[i].isdigit() is not True) and L[i].isdigit():
for j in range(len(L)):
if L[j]==L2[i]: L[j]=L[i]
if L2[j]==L2[i]: L2[j]=L[i]
elif (L[i].isdigit() is not True) and (L2[i].isdigit() is not True):
for j in range(len(L)):
if L[j]==L2[i]: L[j]=L[i]
if L2[j]==L2[i]: L2[j]=L[i]
L,L2=provjera(L,L2)
print("DA")
return
main()
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |