# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164529 | boolodifjenula | Programiranje (COCI17_programiranje) | Cpython 3 | 3058 ms | 4084 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
s=input()
Q=int(input())
O=[]
for i in range (Q):
A,B,C,D=map(int,input().split())
X=s[A-1:B]
Y=s[C-1:D]
for j in range(B-A+1):
t=0
for c in range(B-A+1):
if c==len(Y):
break
if Y[c]==X[j]:
Y=Y[:c]+Y[c+1:]
t=1
break
if t==0:
O+=["NE"]
break
if t: O+=["DA"]
for i in range(Q):
print(O[i])
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |