# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164534 | boolodifjenula | Programiranje (COCI17_programiranje) | Cpython 3 | 3050 ms | 3940 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]
x=26*[0]
y=26*[0]
for j in range(B-A+1):
x[ord(X[j])-97]+=1
y[ord(Y[j])-97]+=1
if x==y: O+=["DA"]
else: O+=["NE"]
for i in range(Q):
print(O[i])
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |