Submission #164534

# Submission time Handle Problem Language Result Execution time Memory
164534 2019-11-21T10:45:16 Z boolodifjenula Programiranje (COCI17_programiranje) Python 3
40 / 80
3000 ms 3940 KB
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
1 Correct 316 ms 3508 KB Output is correct
2 Correct 332 ms 3608 KB Output is correct
3 Correct 349 ms 3508 KB Output is correct
4 Correct 430 ms 3640 KB Output is correct
5 Correct 335 ms 3508 KB Output is correct
6 Execution timed out 3049 ms 3752 KB Time limit exceeded
7 Execution timed out 3037 ms 3940 KB Time limit exceeded
8 Execution timed out 3016 ms 3812 KB Time limit exceeded
9 Execution timed out 3050 ms 3812 KB Time limit exceeded
10 Execution timed out 3031 ms 3860 KB Time limit exceeded